Commit 5f159f981b9d02037825ca5eaf7345510b060085

Authored by 唐高鑫
2 parents c2530605 15ddb63e

Merge remote-tracking branch 'origin/develop' into develop

Showing 27 changed files with 1523 additions and 106 deletions
ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerAdviceList.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 + <a-input placeholder="请输入容器编码" v-model="queryParam.containerCode"></a-input>
  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.locationCode"></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.shipmentCode"></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.materialCode"></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 + <a-input placeholder="请输入物料名称" v-model="queryParam.materialName"></a-input>
  31 + </a-form-item>
  32 + </a-col>
  33 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  34 + <a-form-item label="物料规格">
  35 + <a-input placeholder="请输入物料规格" v-model="queryParam.materialSpec"></a-input>
  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.materialUnit"></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 + <a-input placeholder="请输入批次" v-model="queryParam.batch"></a-input>
  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.status"></a-input>
  51 + </a-form-item>
  52 + </a-col>
  53 + </template>
  54 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  55 + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  56 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  57 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  58 + <a @click="handleToggleSearch" style="margin-left: 8px">
  59 + {{ toggleSearchStatus ? '收起' : '展开' }}
  60 + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  61 + </a>
  62 + </span>
  63 + </a-col>
  64 + </a-row>
  65 + </a-form>
  66 + </div>
  67 + <!-- 查询区域-END -->
  68 +
  69 + <!-- 操作按钮区域 -->
  70 + <div class="table-operator">
  71 + <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  72 + <a-button type="primary" icon="download" @click="handleExportXls('出库预配盘')">导出</a-button>
  73 + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  74 + <a-button type="primary" icon="import">导入</a-button>
  75 + </a-upload>
  76 + <!-- 高级查询区域 -->
  77 + <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  78 + <a-dropdown v-if="selectedRowKeys.length > 0">
  79 + <a-menu slot="overlay">
  80 + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  81 + </a-menu>
  82 + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  83 + </a-dropdown>
  84 + </div>
  85 +
  86 + <!-- table区域-begin -->
  87 + <div>
  88 + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  89 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  90 + <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  91 + </div>
  92 +
  93 + <a-table
  94 + ref="table"
  95 + size="middle"
  96 + :scroll="{x:true}"
  97 + bordered
  98 + rowKey="id"
  99 + :columns="columns"
  100 + :dataSource="dataSource"
  101 + :pagination="ipagination"
  102 + :loading="loading"
  103 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  104 + class="j-table-force-nowrap"
  105 + @change="handleTableChange">
  106 +
  107 + <template slot="htmlSlot" slot-scope="text">
  108 + <div v-html="text"></div>
  109 + </template>
  110 + <template slot="imgSlot" slot-scope="text">
  111 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  112 + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  113 + </template>
  114 + <template slot="fileSlot" slot-scope="text">
  115 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  116 + <a-button
  117 + v-else
  118 + :ghost="true"
  119 + type="primary"
  120 + icon="download"
  121 + size="small"
  122 + @click="downloadFile(text)">
  123 + 下载
  124 + </a-button>
  125 + </template>
  126 +
  127 + <span slot="action" slot-scope="text, record">
  128 + <a @click="handleEdit(record)">编辑</a>
  129 +
  130 + <a-divider type="vertical" />
  131 + <a-dropdown>
  132 + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  133 + <a-menu slot="overlay">
  134 + <a-menu-item>
  135 + <a @click="handleDetail(record)">详情</a>
  136 + </a-menu-item>
  137 + <a-menu-item>
  138 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  139 + <a>删除</a>
  140 + </a-popconfirm>
  141 + </a-menu-item>
  142 + </a-menu>
  143 + </a-dropdown>
  144 + </span>
  145 +
  146 + </a-table>
  147 + </div>
  148 +
  149 + <shipment-container-advice-modal ref="modalForm" @ok="modalFormOk"></shipment-container-advice-modal>
  150 + </a-card>
  151 +</template>
  152 +
  153 +<script>
  154 +
  155 + import '@/assets/less/TableExpand.less'
  156 + import { mixinDevice } from '@/utils/mixin'
  157 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  158 + import ShipmentContainerAdviceModal from './modules/ShipmentContainerAdviceModal'
  159 +
  160 + export default {
  161 + name: 'ShipmentContainerAdviceList',
  162 + mixins:[JeecgListMixin, mixinDevice],
  163 + components: {
  164 + ShipmentContainerAdviceModal
  165 + },
  166 + data () {
  167 + return {
  168 + description: '出库预配盘管理页面',
  169 + // 表头
  170 + columns: [
  171 + {
  172 + title: '#',
  173 + dataIndex: '',
  174 + key:'rowIndex',
  175 + width:60,
  176 + align:"center",
  177 + customRender:function (t,r,index) {
  178 + return parseInt(index)+1;
  179 + }
  180 + },
  181 + {
  182 + title:'容器编码',
  183 + align:"center",
  184 + dataIndex: 'containerCode'
  185 + },
  186 + {
  187 + title:'库位编码',
  188 + align:"center",
  189 + dataIndex: 'locationCode'
  190 + },
  191 + {
  192 + title:'库存明细id',
  193 + align:"center",
  194 + dataIndex: 'inventoryDetailId'
  195 + },
  196 + {
  197 + title:'出库配盘ID',
  198 + align:"center",
  199 + dataIndex: 'shipmentContainerId'
  200 + },
  201 + {
  202 + title:'出库单编码',
  203 + align:"center",
  204 + dataIndex: 'shipmentCode'
  205 + },
  206 + {
  207 + title:'出库单ID',
  208 + align:"center",
  209 + dataIndex: 'shipmentId'
  210 + },
  211 + {
  212 + title:'出库明细id',
  213 + align:"center",
  214 + dataIndex: 'shipmentDetailId'
  215 + },
  216 + {
  217 + title:'货主',
  218 + align:"center",
  219 + dataIndex: 'companyCode'
  220 + },
  221 + {
  222 + title:'物料编码',
  223 + align:"center",
  224 + dataIndex: 'materialCode'
  225 + },
  226 + {
  227 + title:'物料名称',
  228 + align:"center",
  229 + dataIndex: 'materialName'
  230 + },
  231 + {
  232 + title:'物料规格',
  233 + align:"center",
  234 + dataIndex: 'materialSpec'
  235 + },
  236 + {
  237 + title:'物料单位',
  238 + align:"center",
  239 + dataIndex: 'materialUnit'
  240 + },
  241 + {
  242 + title:'批次',
  243 + align:"center",
  244 + dataIndex: 'batch'
  245 + },
  246 + {
  247 + title:'状态',
  248 + align:"center",
  249 + dataIndex: 'status'
  250 + },
  251 + {
  252 + title:'数量',
  253 + align:"center",
  254 + dataIndex: 'qty'
  255 + },
  256 + {
  257 + title:'创建人',
  258 + align:"center",
  259 + dataIndex: 'createBy'
  260 + },
  261 + {
  262 + title:'创建日期',
  263 + align:"center",
  264 + dataIndex: 'createTime'
  265 + },
  266 + {
  267 + title:'更新人',
  268 + align:"center",
  269 + dataIndex: 'updateBy'
  270 + },
  271 + {
  272 + title:'更新日期',
  273 + align:"center",
  274 + dataIndex: 'updateTime'
  275 + },
  276 + {
  277 + title: '操作',
  278 + dataIndex: 'action',
  279 + align:"center",
  280 + fixed:"right",
  281 + width:147,
  282 + scopedSlots: { customRender: 'action' }
  283 + }
  284 + ],
  285 + url: {
  286 + list: "/shipment.shipmentContainerAdvice/shipmentContainerAdvice/list",
  287 + delete: "/shipment.shipmentContainerAdvice/shipmentContainerAdvice/delete",
  288 + deleteBatch: "/shipment.shipmentContainerAdvice/shipmentContainerAdvice/deleteBatch",
  289 + exportXlsUrl: "/shipment.shipmentContainerAdvice/shipmentContainerAdvice/exportXls",
  290 + importExcelUrl: "shipment.shipmentContainerAdvice/shipmentContainerAdvice/importExcel",
  291 +
  292 + },
  293 + dictOptions:{},
  294 + superFieldList:[],
  295 + }
  296 + },
  297 + created() {
  298 + this.getSuperFieldList();
  299 + },
  300 + computed: {
  301 + importExcelUrl: function(){
  302 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  303 + },
  304 + },
  305 + methods: {
  306 + initDictConfig(){
  307 + },
  308 + getSuperFieldList(){
  309 + let fieldList=[];
  310 + fieldList.push({type:'string',value:'containerCode',text:'容器编码',dictCode:''})
  311 + fieldList.push({type:'string',value:'locationCode',text:'库位编码',dictCode:''})
  312 + fieldList.push({type:'int',value:'inventoryDetailId',text:'库存明细id',dictCode:''})
  313 + fieldList.push({type:'int',value:'shipmentContainerId',text:'出库配盘ID',dictCode:''})
  314 + fieldList.push({type:'string',value:'shipmentCode',text:'出库单编码',dictCode:''})
  315 + fieldList.push({type:'int',value:'shipmentId',text:'出库单ID',dictCode:''})
  316 + fieldList.push({type:'int',value:'shipmentDetailId',text:'出库明细id',dictCode:''})
  317 + fieldList.push({type:'string',value:'companyCode',text:'货主',dictCode:''})
  318 + fieldList.push({type:'string',value:'materialCode',text:'物料编码',dictCode:''})
  319 + fieldList.push({type:'string',value:'materialName',text:'物料名称',dictCode:''})
  320 + fieldList.push({type:'string',value:'materialSpec',text:'物料规格',dictCode:''})
  321 + fieldList.push({type:'string',value:'materialUnit',text:'物料单位',dictCode:''})
  322 + fieldList.push({type:'string',value:'batch',text:'批次',dictCode:''})
  323 + fieldList.push({type:'int',value:'status',text:'状态',dictCode:''})
  324 + fieldList.push({type:'BigDecimal',value:'qty',text:'数量',dictCode:''})
  325 + fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''})
  326 + fieldList.push({type:'datetime',value:'createTime',text:'创建日期'})
  327 + fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''})
  328 + fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'})
  329 + this.superFieldList = fieldList
  330 + }
  331 + }
  332 + }
  333 +</script>
  334 +<style scoped>
  335 + @import '~@assets/less/common.less';
  336 +</style>
0 337 \ No newline at end of file
... ...
ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentContainerAdviceForm.vue 0 → 100644
  1 +<template>
  2 + <a-spin :spinning="confirmLoading">
  3 + <j-form-container :disabled="formDisabled">
  4 + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  5 + <a-row>
  6 + <a-col :span="24">
  7 + <a-form-model-item label="容器编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="containerCode">
  8 + <a-input v-model="model.containerCode" placeholder="请输入容器编码" ></a-input>
  9 + </a-form-model-item>
  10 + </a-col>
  11 + <a-col :span="24">
  12 + <a-form-model-item label="库位编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationCode">
  13 + <a-input v-model="model.locationCode" placeholder="请输入库位编码" ></a-input>
  14 + </a-form-model-item>
  15 + </a-col>
  16 + <a-col :span="24">
  17 + <a-form-model-item label="库存明细id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryDetailId">
  18 + <a-input-number v-model="model.inventoryDetailId" placeholder="请输入库存明细id" style="width: 100%" />
  19 + </a-form-model-item>
  20 + </a-col>
  21 + <a-col :span="24">
  22 + <a-form-model-item label="出库配盘ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shipmentContainerId">
  23 + <a-input-number v-model="model.shipmentContainerId" placeholder="请输入出库配盘ID" style="width: 100%" />
  24 + </a-form-model-item>
  25 + </a-col>
  26 + <a-col :span="24">
  27 + <a-form-model-item label="出库单编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shipmentCode">
  28 + <a-input v-model="model.shipmentCode" placeholder="请输入出库单编码" ></a-input>
  29 + </a-form-model-item>
  30 + </a-col>
  31 + <a-col :span="24">
  32 + <a-form-model-item label="出库单ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shipmentId">
  33 + <a-input-number v-model="model.shipmentId" placeholder="请输入出库单ID" style="width: 100%" />
  34 + </a-form-model-item>
  35 + </a-col>
  36 + <a-col :span="24">
  37 + <a-form-model-item label="出库明细id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shipmentDetailId">
  38 + <a-input-number v-model="model.shipmentDetailId" placeholder="请输入出库明细id" style="width: 100%" />
  39 + </a-form-model-item>
  40 + </a-col>
  41 + <a-col :span="24">
  42 + <a-form-model-item label="货主" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="companyCode">
  43 + <a-input v-model="model.companyCode" placeholder="请输入货主" ></a-input>
  44 + </a-form-model-item>
  45 + </a-col>
  46 + <a-col :span="24">
  47 + <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialCode">
  48 + <a-input v-model="model.materialCode" placeholder="请输入物料编码" ></a-input>
  49 + </a-form-model-item>
  50 + </a-col>
  51 + <a-col :span="24">
  52 + <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
  53 + <a-input v-model="model.materialName" placeholder="请输入物料名称" ></a-input>
  54 + </a-form-model-item>
  55 + </a-col>
  56 + <a-col :span="24">
  57 + <a-form-model-item label="物料规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialSpec">
  58 + <a-input v-model="model.materialSpec" placeholder="请输入物料规格" ></a-input>
  59 + </a-form-model-item>
  60 + </a-col>
  61 + <a-col :span="24">
  62 + <a-form-model-item label="物料单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialUnit">
  63 + <a-input v-model="model.materialUnit" placeholder="请输入物料单位" ></a-input>
  64 + </a-form-model-item>
  65 + </a-col>
  66 + <a-col :span="24">
  67 + <a-form-model-item label="批次" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batch">
  68 + <a-input v-model="model.batch" placeholder="请输入批次" ></a-input>
  69 + </a-form-model-item>
  70 + </a-col>
  71 + <a-col :span="24">
  72 + <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
  73 + <a-input-number v-model="model.status" placeholder="请输入状态" style="width: 100%" />
  74 + </a-form-model-item>
  75 + </a-col>
  76 + <a-col :span="24">
  77 + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qty">
  78 + <a-input-number v-model="model.qty" placeholder="请输入数量" style="width: 100%" />
  79 + </a-form-model-item>
  80 + </a-col>
  81 + </a-row>
  82 + </a-form-model>
  83 + </j-form-container>
  84 + </a-spin>
  85 +</template>
  86 +
  87 +<script>
  88 +
  89 + import { httpAction, getAction } from '@/api/manage'
  90 + import { validateDuplicateValue } from '@/utils/util'
  91 +
  92 + export default {
  93 + name: 'ShipmentContainerAdviceForm',
  94 + components: {
  95 + },
  96 + props: {
  97 + //表单禁用
  98 + disabled: {
  99 + type: Boolean,
  100 + default: false,
  101 + required: false
  102 + }
  103 + },
  104 + data () {
  105 + return {
  106 + model:{
  107 + },
  108 + labelCol: {
  109 + xs: { span: 24 },
  110 + sm: { span: 5 },
  111 + },
  112 + wrapperCol: {
  113 + xs: { span: 24 },
  114 + sm: { span: 16 },
  115 + },
  116 + confirmLoading: false,
  117 +validatorRules: {
  118 +},
  119 + url: {
  120 + add: "/shipment.shipmentContainerAdvice/shipmentContainerAdvice/add",
  121 + edit: "/shipment.shipmentContainerAdvice/shipmentContainerAdvice/edit",
  122 + queryById: "/shipment.shipmentContainerAdvice/shipmentContainerAdvice/queryById"
  123 + }
  124 + }
  125 + },
  126 + computed: {
  127 + formDisabled(){
  128 + return this.disabled
  129 + },
  130 + },
  131 + created () {
  132 + //备份model原始值
  133 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  134 + },
  135 + methods: {
  136 + add () {
  137 + this.edit(this.modelDefault);
  138 + },
  139 + edit (record) {
  140 + this.model = Object.assign({}, record);
  141 + this.visible = true;
  142 + },
  143 + submitForm () {
  144 + const that = this;
  145 + // 触发表单验证
  146 + this.$refs.form.validate(valid => {
  147 + if (valid) {
  148 + that.confirmLoading = true;
  149 + let httpurl = '';
  150 + let method = '';
  151 + if(!this.model.id){
  152 + httpurl+=this.url.add;
  153 + method = 'post';
  154 + }else{
  155 + httpurl+=this.url.edit;
  156 + method = 'put';
  157 + }
  158 + httpAction(httpurl,this.model,method).then((res)=>{
  159 + if(res.success){
  160 + that.$message.success(res.message);
  161 + that.$emit('ok');
  162 + }else{
  163 + that.$message.warning(res.message);
  164 + }
  165 + }).finally(() => {
  166 + that.confirmLoading = false;
  167 + })
  168 + }
  169 +
  170 + })
  171 + },
  172 + }
  173 + }
  174 +</script>
0 175 \ No newline at end of file
... ...
ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentContainerAdviceModal.Style#Drawer.vue 0 → 100644
  1 +<template>
  2 + <a-drawer
  3 + :title="title"
  4 + :width="width"
  5 + placement="right"
  6 + :closable="false"
  7 + @close="close"
  8 + destroyOnClose
  9 + :visible="visible">
  10 + <shipment-container-advice-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></shipment-container-advice-form>
  11 + <div class="drawer-footer">
  12 + <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
  13 + <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
  14 + </div>
  15 + </a-drawer>
  16 +</template>
  17 +
  18 +<script>
  19 +
  20 + import ShipmentContainerAdviceForm from './ShipmentContainerAdviceForm'
  21 +
  22 + export default {
  23 + name: 'ShipmentContainerAdviceModal',
  24 + components: {
  25 + ShipmentContainerAdviceForm
  26 + },
  27 + data () {
  28 + return {
  29 + title:"操作",
  30 + width:800,
  31 + visible: false,
  32 + disableSubmit: false
  33 + }
  34 + },
  35 + methods: {
  36 + add () {
  37 + this.visible=true
  38 + this.$nextTick(()=>{
  39 + this.$refs.realForm.add();
  40 + })
  41 + },
  42 + edit (record) {
  43 + this.visible=true
  44 + this.$nextTick(()=>{
  45 + this.$refs.realForm.edit(record);
  46 + });
  47 + },
  48 + close () {
  49 + this.$emit('close');
  50 + this.visible = false;
  51 + },
  52 + submitCallback(){
  53 + this.$emit('ok');
  54 + this.visible = false;
  55 + },
  56 + handleOk () {
  57 + this.$refs.realForm.submitForm();
  58 + },
  59 + handleCancel () {
  60 + this.close()
  61 + }
  62 + }
  63 + }
  64 +</script>
  65 +
  66 +<style lang="less" scoped>
  67 +/** Button按钮间距 */
  68 + .ant-btn {
  69 + margin-left: 30px;
  70 + margin-bottom: 30px;
  71 + float: right;
  72 + }
  73 + .drawer-footer{
  74 + position: absolute;
  75 + bottom: -8px;
  76 + width: 100%;
  77 + border-top: 1px solid #e8e8e8;
  78 + padding: 10px 16px;
  79 + text-align: right;
  80 + left: 0;
  81 + background: #fff;
  82 + border-radius: 0 0 2px 2px;
  83 + }
  84 +</style>
0 85 \ No newline at end of file
... ...
ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentContainerAdviceModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + switchFullscreen
  7 + @ok="handleOk"
  8 + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <shipment-container-advice-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></shipment-container-advice-form>
  12 + </j-modal>
  13 +</template>
  14 +
  15 +<script>
  16 +
  17 + import ShipmentContainerAdviceForm from './ShipmentContainerAdviceForm'
  18 + export default {
  19 + name: 'ShipmentContainerAdviceModal',
  20 + components: {
  21 + ShipmentContainerAdviceForm
  22 + },
  23 + data () {
  24 + return {
  25 + title:'',
  26 + width:800,
  27 + visible: false,
  28 + disableSubmit: false
  29 + }
  30 + },
  31 + methods: {
  32 + add () {
  33 + this.visible=true
  34 + this.$nextTick(()=>{
  35 + this.$refs.realForm.add();
  36 + })
  37 + },
  38 + edit (record) {
  39 + this.visible=true
  40 + this.$nextTick(()=>{
  41 + this.$refs.realForm.edit(record);
  42 + })
  43 + },
  44 + close () {
  45 + this.$emit('close');
  46 + this.visible = false;
  47 + },
  48 + handleOk () {
  49 + this.$refs.realForm.submitForm();
  50 + },
  51 + submitCallback(){
  52 + this.$emit('ok');
  53 + this.visible = false;
  54 + },
  55 + handleCancel () {
  56 + this.close()
  57 + }
  58 + }
  59 + }
  60 +</script>
0 61 \ No newline at end of file
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java
... ... @@ -324,7 +324,7 @@ public class ErpServiceImpl implements IErpService {
324 324 if (shipmentHeader == null) {
325 325 return Result.error("出库单取消, 没有找到出库单");
326 326 }
327   - boolean success = shipmentHeaderService.delMain(String.valueOf(shipmentHeader.getId()));
  327 + boolean success = shipmentHeaderService.delMain(String.valueOf(shipmentHeader.getId()), QuantityConstant.UPSTREAM_DELETE_RECEIPT);
328 328 if (!success) {
329 329 return Result.error("出库单取消失败");
330 330 }
... ... @@ -445,7 +445,9 @@ public class ErpServiceImpl implements IErpService {
445 445 if (!success) {
446 446 throw new JeecgBootException("回传入库单失败, 更新入库单头失败");
447 447 }
448   - receiptHeaderService.delMain(receiptHeader.getId().toString(), QuantityConstant.BACK_DELETE_RECEIPT);
  448 + if (!receiptHeaderService.delMain(receiptHeader.getId().toString(), QuantityConstant.BACK_DELETE_RECEIPT)) {
  449 + throw new JeecgBootException("回传入库单失败, 放进入库历史表单失败");
  450 + }
449 451 return Result.ok("回传入库单成功");
450 452 }
451 453  
... ... @@ -479,6 +481,9 @@ public class ErpServiceImpl implements IErpService {
479 481 if (!success) {
480 482 throw new JeecgBootException("回传出库单失败, 更新出库单头失败");
481 483 }
  484 + if (!shipmentHeaderService.delMain(shipmentHeader.getId().toString(), QuantityConstant.BACK_DELETE_RECEIPT)) {
  485 + throw new JeecgBootException("回传出库单失败, 放进出库历史表单失败");
  486 + }
482 487 return Result.ok("回传出库单成功");
483 488 }
484 489  
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... ... @@ -253,11 +253,16 @@ public class WcsServiceImpl implements WcsService {
253 253 if (destinationLocation == null) {
254 254 throw new JeecgBootException("创建移库任务失败, 目标库位为空");
255 255 }
256   - Result result = taskHeaderService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode);
  256 + Result<TaskHeader> result = taskHeaderService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode);
257 257 if (!result.isSuccess()) {
258 258 throw new JeecgBootException("创建移库任务失败");
259 259 }
260   - return Result.ok("移库任务先执行");
  260 + preTaskNo = result.getResult().getId();
  261 + taskHeader.setPreTaskNo(preTaskNo);
  262 + success = taskHeaderService.updatePreTaskNoById(preTaskNo, taskHeader.getId());
  263 + if (!success) {
  264 + throw new JeecgBootException("更新任务状态失败");
  265 + }
261 266 }
262 267 } else {
263 268 Location outSideLocation = locationService.getOutSideNear(location);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/IHuahengMultiHandlerService.java
... ... @@ -3,7 +3,6 @@ package org.jeecg.modules.wms.framework.service;
3 3 import java.util.List;
4 4  
5 5 import org.jeecg.common.api.vo.Result;
6   -import org.jeecg.modules.system.entity.SysUser;
7 6 import org.jeecg.modules.wms.api.mobile.entity.CallBoxBean;
8 7 import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean;
9 8 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
... ... @@ -37,7 +36,9 @@ public interface IHuahengMultiHandlerService {
37 36  
38 37 Result autoCombination(String shipmentCode, String warehouseCode);
39 38  
40   - Result autoShipment(String shipmentCode, String toPort, String warehouseCode);
  39 + Result autoShipmentAdvice(String shipmentCode, String warehouseCode);
  40 +
  41 + Result autoShipment(String shipmentCode, String warehouseCode);
41 42  
42 43 Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber);
43 44  
... ... @@ -52,5 +53,5 @@ public interface IHuahengMultiHandlerService {
52 53 Result sendTaskToWcs(TaskHeader taskHeader, String zoneCode);
53 54  
54 55 void sendTaskToWcs(List<TaskHeader> taskHeaders, String warehouseCode, String zoneCode);
55   -
  56 +
56 57 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java
... ... @@ -6,9 +6,6 @@ import java.util.List;
6 6 import javax.annotation.Resource;
7 7  
8 8 import org.jeecg.common.api.vo.Result;
9   -import org.jeecg.common.constant.WebsocketConst;
10   -import org.jeecg.modules.message.websocket.WebSocket;
11   -import org.jeecg.modules.system.entity.SysUser;
12 9 import org.jeecg.modules.wms.api.erp.service.IErpService;
13 10 import org.jeecg.modules.wms.api.mobile.entity.CallBoxBean;
14 11 import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean;
... ... @@ -34,8 +31,6 @@ import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
34 31 import org.springframework.scheduling.annotation.Async;
35 32 import org.springframework.stereotype.Service;
36 33  
37   -import com.alibaba.fastjson.JSONObject;
38   -
39 34 import lombok.extern.slf4j.Slf4j;
40 35  
41 36 /**
... ... @@ -185,11 +180,23 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem
185 180 }
186 181  
187 182 @Override
188   - public Result autoShipment(String shipmentCode, String toPort, String warehouseCode) {
  183 + public Result autoShipmentAdvice(String shipmentCode, String warehouseCode) {
  184 + Result result = handleMultiProcess("combination", new MultiProcessListener() {
  185 + @Override
  186 + public Result<?> doProcess() {
  187 + Result result = shipmentHeaderService.autoShipmentAdvice(shipmentCode, warehouseCode);
  188 + return result;
  189 + }
  190 + });
  191 + return result;
  192 + }
  193 +
  194 + @Override
  195 + public Result autoShipment(String shipmentCode, String warehouseCode) {
189 196 Result result = handleMultiProcess("combination", new MultiProcessListener() {
190 197 @Override
191 198 public Result<?> doProcess() {
192   - Result result = shipmentHeaderService.autoShipment(shipmentCode, toPort, warehouseCode);
  199 + Result result = shipmentHeaderService.autoShipment(shipmentCode, warehouseCode);
193 200 return result;
194 201 }
195 202 });
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/service/impl/HomePageViewServiceImpl.java
... ... @@ -3,13 +3,7 @@ package org.jeecg.modules.wms.home.service.impl;
3 3 import java.math.BigDecimal;
4 4 import java.text.ParseException;
5 5 import java.text.SimpleDateFormat;
6   -import java.util.ArrayList;
7   -import java.util.Arrays;
8   -import java.util.Date;
9   -import java.util.HashMap;
10   -import java.util.LinkedHashMap;
11   -import java.util.List;
12   -import java.util.Map;
  6 +import java.util.*;
13 7 import java.util.concurrent.ExecutionException;
14 8 import java.util.concurrent.Future;
15 9 import java.util.concurrent.TimeUnit;
... ... @@ -50,11 +44,7 @@ import com.github.abel533.echarts.Option;
50 44 import com.github.abel533.echarts.axis.Axis;
51 45 import com.github.abel533.echarts.axis.CategoryAxis;
52 46 import com.github.abel533.echarts.axis.ValueAxis;
53   -import com.github.abel533.echarts.code.LegendType;
54   -import com.github.abel533.echarts.code.Orient;
55   -import com.github.abel533.echarts.code.PointerType;
56   -import com.github.abel533.echarts.code.SeriesType;
57   -import com.github.abel533.echarts.code.Trigger;
  47 +import com.github.abel533.echarts.code.*;
58 48 import com.github.abel533.echarts.json.GsonUtil;
59 49 import com.github.abel533.echarts.series.Line;
60 50 import com.github.abel533.echarts.series.Pie;
... ... @@ -101,7 +91,7 @@ public class HomePageViewServiceImpl implements HomePageViewService {
101 91  
102 92 @Resource
103 93 IInventoryTransactionService inventoryTransactionService;
104   -
  94 +
105 95 @Resource
106 96 SystemSync systemSync;
107 97  
... ... @@ -115,10 +105,8 @@ public class HomePageViewServiceImpl implements HomePageViewService {
115 105 for (int i = 6; i >= 0; i--) {
116 106 String startTime = simpleDateFormat.format(dateTime - (1000 * 60 * 60 * 24) * i);
117 107 String endTime = simpleDateFormat.format(DateUtil.offsetDay(simpleDateFormat.parse(startTime), 1));
118   - shipmentQuantityMap.put(startTime,
119   - systemSync.asyncCalculateInventory(startTime, endTime, QuantityConstant.INVENTORY_TRANSACTION_SHIPMENT));
120   - receiptQuantityMap.put(startTime,
121   - systemSync.asyncCalculateInventory(startTime, endTime, QuantityConstant.INVENTORY_TRANSACTION_RECEIPT));
  108 + shipmentQuantityMap.put(startTime, systemSync.asyncCalculateInventory(startTime, endTime, QuantityConstant.INVENTORY_TRANSACTION_SHIPMENT));
  109 + receiptQuantityMap.put(startTime, systemSync.asyncCalculateInventory(startTime, endTime, QuantityConstant.INVENTORY_TRANSACTION_RECEIPT));
122 110 }
123 111 Option option = new Option();
124 112 option.tooltip().trigger(Trigger.axis).axisPointer().type(PointerType.cross);
... ... @@ -130,12 +118,12 @@ public class HomePageViewServiceImpl implements HomePageViewService {
130 118 content.add("#2f4554");
131 119 option.setColor(content);
132 120 option.grid().containLabel(true);
133   - option.legend().data().add("收货量");
134   - option.legend().data().add("发货量");
  121 + option.legend().data().add("入库量");
  122 + option.legend().data().add("出库量");
135 123 Axis axis = new CategoryAxis();
136 124 axis.boundaryGap(false);
137 125 Line line = new Line();
138   - line.setName("发货量");
  126 + line.setName("出库量");
139 127 for (String key : shipmentQuantityMap.keySet()) {
140 128 Object o1 = key;
141 129 Object o2 = shipmentQuantityMap.get(key).get(10000, TimeUnit.MILLISECONDS);
... ... @@ -143,7 +131,7 @@ public class HomePageViewServiceImpl implements HomePageViewService {
143 131 line.data().add(o2);
144 132 }
145 133 Line line2 = new Line();
146   - line2.setName("收货量");
  134 + line2.setName("入库量");
147 135 for (String key : receiptQuantityMap.keySet()) {
148 136 Object o2 = receiptQuantityMap.get(key).get(10000, TimeUnit.MILLISECONDS);
149 137 line2.data().add(o2);
... ... @@ -195,11 +183,11 @@ public class HomePageViewServiceImpl implements HomePageViewService {
195 183 pie.itemStyle().emphasis().setShadowOffsetX(0);
196 184 pie.itemStyle().emphasis().setShadowColor("rgba(0, 0, 0, 0.4)");
197 185  
198   - option.legend().data().add("有货");
199   - pie.data().add(new ChartData("有货", Convert.toDouble(locationStock)));
  186 + option.legend().data().add("占用");
  187 + pie.data().add(new ChartData("占用", Convert.toDouble(locationStock)));
200 188  
201   - option.legend().data().add("无货");
202   - pie.data().add(new ChartData("无货", Convert.toDouble(inStock)));
  189 + option.legend().data().add("空闲");
  190 + pie.data().add(new ChartData("空闲", Convert.toDouble(inStock)));
203 191  
204 192 option.series(pie);
205 193 return Result.ok(GsonUtil.format(option));
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
... ... @@ -370,33 +370,39 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon
370 370 * 选择分拣口
371 371 * @return
372 372 */
373   - @ApiOperation(value = "出库组盘-选择分拣口", notes = "出库组盘-选择分拣口")
  373 + @ApiOperation(value = "出库配盘-选择分拣口", notes = "出库配盘-选择分拣口")
374 374 @PostMapping("/selectSupplePort")
375 375 @ResponseBody
376 376 public Result selectSupplePort(@RequestBody ReceiptContainerHeader receiptContainerHeader, HttpServletRequest req) {
377 377 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
378 378 String fromLocationCode = receiptContainerHeader.getFromLocationCode();
  379 + // 校验起始库位编码
379 380 if (StringUtils.isEmpty(fromLocationCode)) {
380 381 return Result.error("选择分拣口时, 起始库位编码为空");
381 382 }
  383 + // 根据库位编码获取库位信息
382 384 Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
383 385 if (fromLocation == null) {
384 386 return Result.error("选择分拣口时, 根据库位编码" + fromLocationCode + " 没有找到库位");
385 387 }
386 388 String zoneCode = fromLocation.getZoneCode();
387 389 Integer roadWay = fromLocation.getRoadWay();
  390 + // 校验库区编码
388 391 if (StringUtils.isEmpty(zoneCode)) {
389 392 return Result.error("选择分拣口时, 库区编码为空");
390 393 }
391 394 Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode);
  395 + // 校验库区
392 396 if (zone == null) {
393 397 return Result.error("选择分拣口时, 库区为空");
394 398 }
395 399 int type = QuantityConstant.PORT_TYPE_PICK;
396 400 List<Port> portList = portService.getPortListByType(type, roadWay, zoneCode, warehouseCode);
  401 + // 校验分拣口
397 402 if (portList.size() == 0) {
398 403 return Result.error("选择分拣口时, 没有找到合适的分拣口");
399 404 }
400 405 return Result.OK(portList);
401 406 }
  407 +
402 408 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/IShipmentCombinationService.java
... ... @@ -7,6 +7,7 @@ import org.jeecg.common.api.vo.Result;
7 7 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
8 8 import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel;
9 9 import org.jeecg.modules.wms.shipment.shipmentCombination.entity.FlatShipment;
  10 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice;
10 11 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail;
11 12 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
12 13 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
... ... @@ -24,6 +25,8 @@ public interface IShipmentCombinationService {
24 25  
25 26 Result autoCombination(String shipmentCode, String warehouseCode);
26 27  
  28 + Result autoCombination(String shipmentCode, boolean advice, String warehouseCode);
  29 +
27 30 Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber);
28 31  
29 32 Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, int forceTaskType, String warehouseCode);
... ... @@ -39,12 +42,18 @@ public interface IShipmentCombinationService {
39 42  
40 43 Result combination(CombinationModel combinationModel);
41 44  
  45 + Result combinationAdvice(CombinationModel combinationModel);
  46 +
42 47 Result autoCombinationDetail(ShipmentDetail shipmentDetail, BigDecimal shipQty);
43 48  
  49 + Result autoCombinationDetail(ShipmentDetail shipmentDetail, boolean advice, BigDecimal shipQty);
  50 +
44 51 ShipmentContainerHeader addShipmentContainerHeader(InventoryDetail inventoryDetail, ShipmentDetail shipmentDetail);
45 52  
46 53 ShipmentContainerDetail addShipmentContainerDetail(ShipmentContainerHeader shipmentContainerHeader, CombinationModel combinationModel);
47 54  
  55 + ShipmentContainerAdvice addShipmentContainerAdvice(ShipmentContainerHeader shipmentContainerHeader, CombinationModel combinationModel);
  56 +
48 57 /**
49 58 * 平库出库,有实物托盘号
50 59 * @return
... ... @@ -61,4 +70,6 @@ public interface IShipmentCombinationService {
61 70 * 根据配盘信息,完成平库出库
62 71 */
63 72 Result completeFlatShipment(ShipmentContainerHeader shipmentContainerHeader);
  73 +
  74 + Result createCallShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber);
64 75 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... ... @@ -31,6 +31,8 @@ import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptCont
31 31 import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel;
32 32 import org.jeecg.modules.wms.shipment.shipmentCombination.entity.FlatShipment;
33 33 import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService;
  34 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice;
  35 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.IShipmentContainerAdviceService;
34 36 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail;
35 37 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
36 38 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService;
... ... @@ -122,6 +124,8 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
122 124 private WcsService wcsService;
123 125 @Resource
124 126 private IAgvTaskService agvTaskService;
  127 + @Resource
  128 + private IShipmentContainerAdviceService shipmentContainerAdviceService;
125 129  
126 130 /**
127 131 * 根据出库单详情,匹配到可用出库的库存详情
... ... @@ -246,6 +250,12 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
246 250 @Override
247 251 @Transactional(rollbackFor = JeecgBootException.class)
248 252 public Result autoCombination(String shipmentCode, String warehouseCode) {
  253 + return shipmentCombinationService.autoCombination(shipmentCode, false, warehouseCode);
  254 + }
  255 +
  256 + @Override
  257 + @Transactional(rollbackFor = JeecgBootException.class)
  258 + public Result autoCombination(String shipmentCode, boolean advice, String warehouseCode) {
249 259 log.info("开始自动配盘,单号" + shipmentCode);
250 260 LambdaQueryWrapper<ShipmentHeader> shipmentHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
251 261 shipmentHeaderLambdaQueryWrapper.eq(ShipmentHeader::getWarehouseCode, warehouseCode).eq(ShipmentHeader::getCode, shipmentCode);
... ... @@ -267,7 +277,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
267 277 if (shipmentDetail.getTaskQty().compareTo(shipmentDetail.getQty()) < 0) {
268 278 over = false;
269 279 }
270   - Result result = shipmentCombinationService.autoCombinationDetail(shipmentDetail, null);
  280 + Result result = shipmentCombinationService.autoCombinationDetail(shipmentDetail, advice, null);
271 281 if (!result.isSuccess()) {
272 282 throw new JeecgBootException(result.getMessage());
273 283 }
... ... @@ -280,18 +290,29 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
280 290 }
281 291  
282 292 @Override
  293 + @Transactional(rollbackFor = JeecgBootException.class)
283 294 public Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber) {
284   - return createShipmentTask(shipmentContainerHeader, 0, warehouseCode, shipmentOrder, sequence, sequenceNumber);
  295 + return shipmentCombinationService.createShipmentTask(shipmentContainerHeader, 0, warehouseCode, shipmentOrder, sequence, sequenceNumber);
285 296 }
286 297  
287 298 @Override
  299 + @Transactional(rollbackFor = JeecgBootException.class)
288 300 public Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, int forceTaskType, String warehouseCode) {
289   - return createShipmentTask(shipmentContainerHeader, forceTaskType, warehouseCode, 0, 0, 0);
  301 + return shipmentCombinationService.createShipmentTask(shipmentContainerHeader, forceTaskType, warehouseCode, 0, 0, 0);
290 302 }
291 303  
292 304 @Override
293 305 @Transactional(rollbackFor = JeecgBootException.class)
294 306 public Result autoCombinationDetail(ShipmentDetail shipmentDetail, BigDecimal shipQty) {
  307 + return shipmentCombinationService.autoCombinationDetail(shipmentDetail, false, shipQty);
  308 + }
  309 +
  310 + /**
  311 + * 出库单据明细自动配盘
  312 + */
  313 + @Override
  314 + @Transactional(rollbackFor = JeecgBootException.class)
  315 + public Result autoCombinationDetail(ShipmentDetail shipmentDetail, boolean advice, BigDecimal shipQty) {
295 316 // 出库数量
296 317 BigDecimal shipmentQty = shipmentDetail.getQty().subtract(shipmentDetail.getTaskQty());
297 318 // 判断是否还有需要出库的物料,如果没有就跳过该物料
... ... @@ -305,7 +326,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
305 326 // 去除已锁的库存
306 327 ArrayList<InventoryDetail> removeInventoryList = new ArrayList<>();
307 328 List<ReceiptContainerHeader> receiptContainerHeaderList = receiptContainerHeaderService.getUnCompleteCombineList();
308   -// List<ShipmentContainerHeader> shipmentContainerHeaderList = shipmentContainerHeaderService.getUnCompleteCombineList();
  329 + List<ShipmentContainerHeader> shipmentContainerHeaderList = shipmentContainerHeaderService.getNotCombineList();
309 330 for (InventoryDetail inventoryDetail : inventoryList) {
310 331 String containerCode = inventoryDetail.getContainerCode();
311 332 String warehouseCode = inventoryDetail.getWarehouseCode();
... ... @@ -323,12 +344,12 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
323 344 continue;
324 345 }
325 346 }
326   -// for (ShipmentContainerHeader shipmentContainerHeader : shipmentContainerHeaderList) {
327   -// if (shipmentContainerHeader.getContainerCode().equals(containerCode)) {
328   -// removeInventoryList.add(inventoryDetail);
329   -// continue;
330   -// }
331   -// }
  347 + for (ShipmentContainerHeader shipmentContainerHeader : shipmentContainerHeaderList) {
  348 + if (shipmentContainerHeader.getContainerCode().equals(containerCode)) {
  349 + removeInventoryList.add(inventoryDetail);
  350 + continue;
  351 + }
  352 + }
332 353 }
333 354 inventoryList.removeAll(removeInventoryList);
334 355 if (inventoryList.size() < 1) {
... ... @@ -354,12 +375,19 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
354 375 combinationModel.setShipQty(inventoryQty);
355 376 shipmentQty = shipmentQty.subtract(inventoryQty);
356 377 }
357   - Result result = shipmentCombinationService.combination(combinationModel);
358   - if (!result.isSuccess()) {
359   - throw new JeecgBootException(result.getMessage());
  378 + if (advice) {
  379 + Result result = shipmentCombinationService.combinationAdvice(combinationModel);
  380 + if (!result.isSuccess()) {
  381 + throw new JeecgBootException(result.getMessage());
  382 + }
  383 + } else {
  384 + Result result = shipmentCombinationService.combination(combinationModel);
  385 + if (!result.isSuccess()) {
  386 + throw new JeecgBootException(result.getMessage());
  387 + }
360 388 }
361 389 }
362   - return Result.OK("自动盘成功", null);
  390 + return Result.OK("自动盘成功", null);
363 391 }
364 392  
365 393 @Override
... ... @@ -484,6 +512,121 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
484 512  
485 513 @Override
486 514 @Transactional(rollbackFor = JeecgBootException.class)
  515 + @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情配盘'", extra = "#extraJsonString", msg = "''", recordReturnValue = true)
  516 + public Result combinationAdvice(CombinationModel combinationModel) {
  517 + BigDecimal shipmentQty = combinationModel.getShipQty();
  518 + ShipmentDetail shipmentDetail = combinationModel.getShipmentDetail();
  519 + InventoryDetail inventoryDetail = combinationModel.getInventoryDetail();
  520 + log.info("开始出库配盘" + shipmentDetail);
  521 + if (shipmentQty.compareTo(BigDecimal.ZERO) <= 0) {
  522 + return Result.error("配盘时,出库数量必须大于0");
  523 + }
  524 + if (shipmentDetail == null) {
  525 + return Result.error("配盘时,出库明细未找到");
  526 + }
  527 + if (inventoryDetail == null) {
  528 + return Result.error("配盘时,库存未找到");
  529 + }
  530 + String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_SHIPMENT_ZONE);
  531 + if (StringUtils.isNotEmpty(value)) {
  532 + int shipmentZoneRule = Integer.parseInt(value);
  533 + if (shipmentZoneRule == QuantityConstant.SHIPMENT_BY_ZONE) {
  534 + if (StringUtils.isEmpty(inventoryDetail.getZoneCode())) {
  535 + return Result.error("配盘时,库存没有库区");
  536 + }
  537 + if (!inventoryDetail.getZoneCode().equals(shipmentDetail.getZoneCode())) {
  538 + return Result.error("配盘时,库存和库区不匹配");
  539 + }
  540 + }
  541 + }
  542 + String locationCode = inventoryDetail.getLocationCode();
  543 + String containerCode = inventoryDetail.getContainerCode();
  544 + String warehouseCode = inventoryDetail.getWarehouseCode();
  545 + if (!warehouseCode.equals(shipmentDetail.getWarehouseCode())) {
  546 + return Result.error("配盘时,库存仓库编码和出库单仓库编码不一致");
  547 + }
  548 + boolean success = receiptContainerHeaderService.havaUnCompleteCombineByContainerCode(containerCode, warehouseCode);
  549 + if (success) {
  550 + return Result.error("配盘时, 容器:" + containerCode + " 已经用于入库组盘");
  551 + }
  552 + Location location = locationService.getLocationByCode(locationCode, warehouseCode);
  553 + if (location == null) {
  554 + return Result.error("配盘时, 没有找到库位, 编码" + locationCode);
  555 + }
  556 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  557 + if (container == null) {
  558 + return Result.error("配盘时, 没有找到容器, 编码" + containerCode);
  559 + }
  560 + int callBox = QuantityConstant.NOT_CALL_BOX;
  561 + TaskHeader callBoxTask = taskHeaderService.getUnCompleteTaskByContainerCode(containerCode, warehouseCode);
  562 + if (callBoxTask != null) {
  563 + callBox = callBoxTask.getCallBox();
  564 + }
  565 + // 如果不是呼叫料盒,那么要判断容器状态
  566 + if (callBox == QuantityConstant.NOT_CALL_BOX) {
  567 + if (container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) {
  568 + return Result.error("配盘时, 容器已经锁定,不能再配盘");
  569 + }
  570 + }
  571 + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getUnCompleteReceiptContainerByCode(containerCode, warehouseCode);
  572 + if (receiptContainerHeader != null) {
  573 + return Result.error("配盘时, 容器有入库组盘不能再配盘,容器编码" + containerCode);
  574 + }
  575 + BigDecimal shipmentDetailQty = shipmentDetail.getQty();
  576 + BigDecimal shipmentDetailTaskQty = shipmentDetail.getTaskQty();
  577 + // 可出数量
  578 + BigDecimal shipmentDetailAvailableQty = shipmentDetailQty.subtract(shipmentDetailTaskQty);
  579 + if (shipmentDetailAvailableQty.compareTo(shipmentQty) < 0) {
  580 + return Result.error("配盘时, 录入数量超出出库单明细待出数量");
  581 + }
  582 + BigDecimal inventoryDetailQty = inventoryDetail.getQty();
  583 + BigDecimal inventoryDetailTaskQty = inventoryDetail.getTaskQty();
  584 + BigDecimal inventoryDetailAvailableQty = inventoryDetailQty.subtract(inventoryDetailTaskQty);
  585 + if (inventoryDetailAvailableQty.compareTo(shipmentQty) < 0) {
  586 + return Result.error("配盘时, 录入数量超出库存详情待出数量");
  587 + }
  588 + if (!shipmentDetail.getMaterialCode().equals(inventoryDetail.getMaterialCode())) {
  589 + return Result.error("配盘时, 配盘物料不一致");
  590 + }
  591 + inventoryDetailTaskQty = inventoryDetailTaskQty.add(shipmentQty);
  592 + if (inventoryDetailTaskQty.compareTo(BigDecimal.ZERO) <= 0) {
  593 + return Result.error("配盘时, 库存详情的任务数量必须大于0");
  594 + }
  595 + if (inventoryDetailTaskQty.compareTo(inventoryDetailQty) > 0) {
  596 + return Result.error("配盘时, 库存详情的任务数量不能超过库存数量");
  597 + }
  598 + shipmentDetailTaskQty = shipmentDetailTaskQty.add(shipmentQty);
  599 + if (shipmentDetailTaskQty.compareTo(BigDecimal.ZERO) <= 0) {
  600 + return Result.error("配盘时, 出库详情的任务数量必须大于0");
  601 + }
  602 + if (shipmentDetailTaskQty.compareTo(shipmentDetailQty) > 0) {
  603 + return Result.error("配盘时, 出库详情的任务数量不能超过单据数量");
  604 + }
  605 + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK);
  606 + shipmentDetail.setTaskQty(shipmentDetailTaskQty);
  607 + success = shipmentDetailService.updateTaskQtyAndStatusById(shipmentDetailTaskQty, QuantityConstant.SHIPMENT_HEADER_GROUPDISK, shipmentDetail.getId());
  608 + if (!success) {
  609 + throw new JeecgBootException("配盘时, 更新出库详情失败");
  610 + }
  611 + ShipmentContainerHeader shipmentContainerHeader = shipmentCombinationService.addShipmentContainerHeader(inventoryDetail, shipmentDetail);
  612 + if (shipmentContainerHeader == null) {
  613 + throw new JeecgBootException("配盘时, 新增出库组盘头失败");
  614 + }
  615 + ShipmentContainerAdvice shipmentContainerAdvice = shipmentCombinationService.addShipmentContainerAdvice(shipmentContainerHeader, combinationModel);
  616 + if (shipmentContainerAdvice == null) {
  617 + throw new JeecgBootException("配盘时, 新增出库组盘详情失败");
  618 + }
  619 + success = shipmentHeaderService.updateShipmentHeaderStatus(shipmentDetail.getShipmentId());
  620 + if (!success) {
  621 + throw new JeecgBootException("配盘时, 更新出库单失败");
  622 + }
  623 + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentContainerAdvice)));
  624 + log.info("完成出库配盘" + shipmentDetail);
  625 + return Result.ok("配盘成功");
  626 + }
  627 +
  628 + @Override
  629 + @Transactional(rollbackFor = JeecgBootException.class)
487 630 public ShipmentContainerHeader addShipmentContainerHeader(InventoryDetail inventoryDetail, ShipmentDetail shipmentDetail) {
488 631 String containerCode = inventoryDetail.getContainerCode();
489 632 String warehouseCode = inventoryDetail.getWarehouseCode();
... ... @@ -560,8 +703,6 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
560 703 BigDecimal shipmentQty = combinationModel.getShipQty();
561 704 ShipmentDetail shipmentDetail = combinationModel.getShipmentDetail();
562 705 InventoryDetail inventoryDetail = combinationModel.getInventoryDetail();
563   -// String locationCode = inventoryDetail.getLocationCode();
564   -// String containerCode = inventoryDetail.getContainerCode();
565 706 String warehouseCode = inventoryDetail.getWarehouseCode();
566 707 String materialCode = inventoryDetail.getMaterialCode();
567 708 LambdaQueryWrapper<ShipmentContainerDetail> shipmentContainerDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
... ... @@ -611,6 +752,56 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
611 752  
612 753 @Override
613 754 @Transactional(rollbackFor = JeecgBootException.class)
  755 + public ShipmentContainerAdvice addShipmentContainerAdvice(ShipmentContainerHeader shipmentContainerHeader, CombinationModel combinationModel) {
  756 + boolean success = false;
  757 + BigDecimal shipmentQty = combinationModel.getShipQty();
  758 + ShipmentDetail shipmentDetail = combinationModel.getShipmentDetail();
  759 + InventoryDetail inventoryDetail = combinationModel.getInventoryDetail();
  760 + String warehouseCode = inventoryDetail.getWarehouseCode();
  761 + String materialCode = inventoryDetail.getMaterialCode();
  762 + LambdaQueryWrapper<ShipmentContainerAdvice> shipmentContainerAdviceLambdaQueryWrapper = Wrappers.lambdaQuery();
  763 + shipmentContainerAdviceLambdaQueryWrapper.eq(ShipmentContainerAdvice::getShipmentContainerId, shipmentContainerHeader.getId())
  764 + .eq(ShipmentContainerAdvice::getShipmentDetailId, shipmentDetail.getId()).eq(ShipmentContainerAdvice::getInventoryDetailId, inventoryDetail.getId())
  765 + .eq(ShipmentContainerAdvice::getWarehouseCode, warehouseCode);
  766 + ShipmentContainerAdvice shipmentContainerAdvice = shipmentContainerAdviceService.getOne(shipmentContainerAdviceLambdaQueryWrapper);
  767 + if (shipmentContainerAdvice != null) {
  768 + BigDecimal qty = shipmentContainerAdvice.getQty().add(combinationModel.getShipQty());
  769 + shipmentContainerAdvice.setQty(qty);
  770 + success = shipmentContainerAdviceService.updateQtyById(qty, shipmentContainerAdvice.getId());
  771 + if (!success) {
  772 + throw new JeecgBootException("更新出库组盘详情失败");
  773 + }
  774 + } else {
  775 + Material material = materialService.getMaterialByCode(materialCode);
  776 + if (material == null) {
  777 + throw new JeecgBootException("出库单(" + shipmentDetail.getShipmentCode() + ")的物料(" + materialCode + ")不存在!");
  778 + }
  779 + shipmentContainerAdvice = new ShipmentContainerAdvice();
  780 + shipmentContainerAdvice.setWarehouseCode(shipmentContainerHeader.getWarehouseCode());
  781 + shipmentContainerAdvice.setCompanyCode(shipmentDetail.getCompanyCode());
  782 + shipmentContainerAdvice.setContainerCode(shipmentContainerHeader.getContainerCode());
  783 + shipmentContainerAdvice.setInventoryDetailId(inventoryDetail.getId());
  784 + shipmentContainerAdvice.setShipmentCode(shipmentDetail.getShipmentCode());
  785 + shipmentContainerAdvice.setShipmentId(shipmentDetail.getShipmentId());
  786 + shipmentContainerAdvice.setShipmentDetailId(shipmentDetail.getId());
  787 + shipmentContainerAdvice.setShipmentContainerId(shipmentContainerHeader.getId());
  788 + shipmentContainerAdvice.setMaterialCode(shipmentDetail.getMaterialCode());
  789 + shipmentContainerAdvice.setMaterialName(shipmentDetail.getMaterialName());
  790 + shipmentContainerAdvice.setMaterialSpec(shipmentDetail.getMaterialSpec());
  791 + shipmentContainerAdvice.setMaterialUnit(shipmentDetail.getMaterialUnit());
  792 + shipmentContainerAdvice.setQty(shipmentQty);
  793 + shipmentContainerAdvice.setBatch(shipmentDetail.getBatch());
  794 + shipmentContainerAdvice.setStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD);
  795 + success = shipmentContainerAdviceService.save(shipmentContainerAdvice);
  796 + if (!success) {
  797 + throw new JeecgBootException("新建预配盘明细失败,sql错误");
  798 + }
  799 + }
  800 + return shipmentContainerAdvice;
  801 + }
  802 +
  803 + @Override
  804 + @Transactional(rollbackFor = JeecgBootException.class)
614 805 public Result flatShipmentByContainerCode(String containerCode, List<FlatShipment> flatShipments, String warehouseCode) {
615 806 Container container = containerService.getContainerByCode(containerCode, warehouseCode);
616 807 if (container == null) {
... ... @@ -997,6 +1188,95 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
997 1188  
998 1189 @Override
999 1190 @Transactional(rollbackFor = JeecgBootException.class)
  1191 + public Result createCallShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence,
  1192 + int sequenceNumber) {
  1193 + Integer preTaskNo = 0;
  1194 + if (shipmentContainerHeader == null) {
  1195 + return Result.error("生成出库任务时, 出库组盘头" + "未找到,操作中止");
  1196 + }
  1197 + if (shipmentContainerHeader.getStatus() >= QuantityConstant.SHIPMENT_CONTAINER_TASK) {
  1198 + return Result.error("生成出库任务时, 出库组盘头" + shipmentContainerHeader.getId() + "已经生成任务,请不要重复生成,操作中止");
  1199 + }
  1200 + if (!shipmentContainerHeader.getWarehouseCode().equals(warehouseCode)) {
  1201 + return Result.error("生成出库任务时, 出库组盘头" + shipmentContainerHeader.getId() + "仓库编码和登录的仓库编码不一致");
  1202 + }
  1203 + String fromLocationCode = shipmentContainerHeader.getFromLocationCode();
  1204 + String containerCode = shipmentContainerHeader.getContainerCode();
  1205 + if (StringUtils.isEmpty(fromLocationCode)) {
  1206 + return Result.error("生成出库任务时, 出库组盘头没有起始库位号");
  1207 + }
  1208 + Location location = locationService.getLocationByCode(fromLocationCode, warehouseCode);
  1209 + if (location == null) {
  1210 + return Result.error("生成出库任务时, 库位号" + fromLocationCode + "没有找到库位");
  1211 + }
  1212 + if (location.getRowFlag() == QuantityConstant.ROW_OUT) {
  1213 + Location location1 = locationService.getNear(location);
  1214 + if (location1 != null) {
  1215 + String locationCode = location1.getCode();
  1216 + TaskHeader taskHeader = taskHeaderService.getUnCompleteTaskByToLocationCode(locationCode, warehouseCode);
  1217 + if (taskHeader != null) {
  1218 + preTaskNo = taskHeader.getPreTaskNo();
  1219 + }
  1220 + }
  1221 + }
  1222 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  1223 + if (container == null) {
  1224 + return Result.error("生成出库任务时, 托盘不存在" + containerCode);
  1225 + }
  1226 + if (container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) {
  1227 + return Result.error("生成出库任务时, 托盘已经锁定,containerCode:" + containerCode);
  1228 + }
  1229 + container.setStatus(QuantityConstant.STATUS_CONTAINER_LOCK);
  1230 + boolean success = containerService.updateById(container);
  1231 + if (!success) {
  1232 + throw new JeecgBootException("生成出库任务时, 更新容器失败,containerCode:" + containerCode);
  1233 + }
  1234 + success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
  1235 + if (!success) {
  1236 + throw new JeecgBootException("生成出库任务时, 更新库位失败,fromLocationCode:" + fromLocationCode);
  1237 + }
  1238 + int taskType = QuantityConstant.TASK_TYPE_SORTINGSHIPMENT;
  1239 + String zoneCode = location.getZoneCode();
  1240 +// if (taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) {
  1241 +// shipmentContainerHeader.setToLocationCode(fromLocationCode);
  1242 +// }
  1243 + shipmentContainerHeader.setTaskType(taskType);
  1244 + TaskHeader taskHeader = new TaskHeader();
  1245 + taskHeader.setPreTaskNo(preTaskNo);
  1246 + taskHeader.setTaskType(taskType);
  1247 + taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_SHIPMENT);
  1248 + taskHeader.setZoneCode(zoneCode);
  1249 + taskHeader.setShipmentOrder(shipmentOrder);
  1250 + taskHeader.setSequence(sequence);
  1251 + taskHeader.setSequenceNumber(sequenceNumber);
  1252 + taskHeader.setWarehouseCode(warehouseCode);
  1253 + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  1254 + taskHeader.setContainerCode(containerCode);
  1255 + taskHeader.setToPortCode(shipmentContainerHeader.getToPort());
  1256 + taskHeader.setFromLocationCode(fromLocationCode);
  1257 + if (taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) {
  1258 + taskHeader.setToLocationCode(fromLocationCode);
  1259 + }
  1260 + taskHeader.setShipmentContainerHeaderId(shipmentContainerHeader.getId());
  1261 + success = taskHeaderService.save(taskHeader);
  1262 + if (!success) {
  1263 + throw new JeecgBootException("生成出库任务时, 创建任务失败");
  1264 + }
  1265 + shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_TASK);
  1266 + success = shipmentContainerHeaderService.updateById(shipmentContainerHeader);
  1267 + if (!success) {
  1268 + throw new JeecgBootException("生成出库任务时, 更新出库组盘头失败");
  1269 + }
  1270 + success = inventoryHeaderService.updateInventoryContainerStatusByContainerCode(containerCode, warehouseCode);
  1271 + if (!success) {
  1272 + throw new JeecgBootException("生成出库任务时, 更新库存头失败");
  1273 + }
  1274 + LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集
  1275 + return Result.OK("生成出库任务成功", taskHeader);
  1276 + }
  1277 +
  1278 + @Override
  1279 + @Transactional(rollbackFor = JeecgBootException.class)
1000 1280 @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'出库任务生成'", extra = "#extraJsonString1",
1001 1281 msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #shipmentContainerHeader.getFromLocationCode() + ',容器编码:' + #shipmentContainerHeader.getContainerCode() + ',目标出入口:' + #shipmentContainerHeader.getToPort()",
1002 1282 condition = "#shipmentContainerDetailList.size() > 0", recordReturnValue = true)
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/controller/ShipmentContainerAdviceController.java 0 → 100644
  1 +package org.jeecg.modules.wms.shipment.shipmentContainerAdvice.controller;
  2 +
  3 +import java.util.Arrays;
  4 +import java.util.List;
  5 +import java.util.Map;
  6 +import java.util.stream.Collectors;
  7 +import java.io.IOException;
  8 +import java.io.UnsupportedEncodingException;
  9 +import java.net.URLDecoder;
  10 +import javax.servlet.http.HttpServletRequest;
  11 +import javax.servlet.http.HttpServletResponse;
  12 +import org.jeecg.common.api.vo.Result;
  13 +import org.jeecg.common.system.query.QueryGenerator;
  14 +import org.jeecg.common.util.oConvertUtils;
  15 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice;
  16 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.IShipmentContainerAdviceService;
  17 +
  18 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  19 +import com.baomidou.mybatisplus.core.metadata.IPage;
  20 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  21 +import lombok.extern.slf4j.Slf4j;
  22 +
  23 +import org.jeecgframework.poi.excel.ExcelImportUtil;
  24 +import org.jeecgframework.poi.excel.def.NormalExcelConstants;
  25 +import org.jeecgframework.poi.excel.entity.ExportParams;
  26 +import org.jeecgframework.poi.excel.entity.ImportParams;
  27 +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
  28 +import org.jeecg.common.system.base.controller.JeecgController;
  29 +import org.springframework.beans.factory.annotation.Autowired;
  30 +import org.springframework.web.bind.annotation.*;
  31 +import org.springframework.web.multipart.MultipartFile;
  32 +import org.springframework.web.multipart.MultipartHttpServletRequest;
  33 +import org.springframework.web.servlet.ModelAndView;
  34 +import com.alibaba.fastjson.JSON;
  35 +import io.swagger.annotations.Api;
  36 +import io.swagger.annotations.ApiOperation;
  37 +import org.jeecg.common.aspect.annotation.AutoLog;
  38 +
  39 + /**
  40 + * @Description: 出库预配盘
  41 + * @Author: jeecg-boot
  42 + * @Date: 2023-11-16
  43 + * @Version: V1.0
  44 + */
  45 +@Api(tags="出库预配盘")
  46 +@RestController
  47 +@RequestMapping("/shipment.shipmentContainerAdvice/shipmentContainerAdvice")
  48 +@Slf4j
  49 +public class ShipmentContainerAdviceController extends JeecgController<ShipmentContainerAdvice, IShipmentContainerAdviceService> {
  50 + @Autowired
  51 + private IShipmentContainerAdviceService shipmentContainerAdviceService;
  52 +
  53 + /**
  54 + * 分页列表查询
  55 + *
  56 + * @param shipmentContainerAdvice
  57 + * @param pageNo
  58 + * @param pageSize
  59 + * @param req
  60 + * @return
  61 + */
  62 + //@AutoLog(value = "出库预配盘-分页列表查询")
  63 + @ApiOperation(value="出库预配盘-分页列表查询", notes="出库预配盘-分页列表查询")
  64 + @GetMapping(value = "/list")
  65 + public Result<IPage<ShipmentContainerAdvice>> queryPageList(ShipmentContainerAdvice shipmentContainerAdvice,
  66 + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
  67 + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
  68 + HttpServletRequest req) {
  69 + QueryWrapper<ShipmentContainerAdvice> queryWrapper = QueryGenerator.initQueryWrapper(shipmentContainerAdvice, req.getParameterMap());
  70 + Page<ShipmentContainerAdvice> page = new Page<ShipmentContainerAdvice>(pageNo, pageSize);
  71 + IPage<ShipmentContainerAdvice> pageList = shipmentContainerAdviceService.page(page, queryWrapper);
  72 + return Result.OK(pageList);
  73 + }
  74 +
  75 + /**
  76 + * 添加
  77 + *
  78 + * @param shipmentContainerAdvice
  79 + * @return
  80 + */
  81 + @AutoLog(value = "出库预配盘-添加")
  82 + @ApiOperation(value="出库预配盘-添加", notes="出库预配盘-添加")
  83 + @PostMapping(value = "/add")
  84 + public Result<String> add(@RequestBody ShipmentContainerAdvice shipmentContainerAdvice) {
  85 + shipmentContainerAdviceService.save(shipmentContainerAdvice);
  86 + return Result.OK("添加成功!");
  87 + }
  88 +
  89 + /**
  90 + * 编辑
  91 + *
  92 + * @param shipmentContainerAdvice
  93 + * @return
  94 + */
  95 + @AutoLog(value = "出库预配盘-编辑")
  96 + @ApiOperation(value="出库预配盘-编辑", notes="出库预配盘-编辑")
  97 + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
  98 + public Result<String> edit(@RequestBody ShipmentContainerAdvice shipmentContainerAdvice) {
  99 + shipmentContainerAdviceService.updateById(shipmentContainerAdvice);
  100 + return Result.OK("编辑成功!");
  101 + }
  102 +
  103 + /**
  104 + * 通过id删除
  105 + *
  106 + * @param id
  107 + * @return
  108 + */
  109 + @AutoLog(value = "出库预配盘-通过id删除")
  110 + @ApiOperation(value="出库预配盘-通过id删除", notes="出库预配盘-通过id删除")
  111 + @DeleteMapping(value = "/delete")
  112 + public Result<String> delete(@RequestParam(name="id",required=true) String id) {
  113 + shipmentContainerAdviceService.removeById(id);
  114 + return Result.OK("删除成功!");
  115 + }
  116 +
  117 + /**
  118 + * 批量删除
  119 + *
  120 + * @param ids
  121 + * @return
  122 + */
  123 + @AutoLog(value = "出库预配盘-批量删除")
  124 + @ApiOperation(value="出库预配盘-批量删除", notes="出库预配盘-批量删除")
  125 + @DeleteMapping(value = "/deleteBatch")
  126 + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
  127 + this.shipmentContainerAdviceService.removeByIds(Arrays.asList(ids.split(",")));
  128 + return Result.OK("批量删除成功!");
  129 + }
  130 +
  131 + /**
  132 + * 通过id查询
  133 + *
  134 + * @param id
  135 + * @return
  136 + */
  137 + //@AutoLog(value = "出库预配盘-通过id查询")
  138 + @ApiOperation(value="出库预配盘-通过id查询", notes="出库预配盘-通过id查询")
  139 + @GetMapping(value = "/queryById")
  140 + public Result<ShipmentContainerAdvice> queryById(@RequestParam(name="id",required=true) String id) {
  141 + ShipmentContainerAdvice shipmentContainerAdvice = shipmentContainerAdviceService.getById(id);
  142 + if(shipmentContainerAdvice==null) {
  143 + return Result.error("未找到对应数据");
  144 + }
  145 + return Result.OK(shipmentContainerAdvice);
  146 + }
  147 +
  148 + /**
  149 + * 导出excel
  150 + *
  151 + * @param request
  152 + * @param shipmentContainerAdvice
  153 + */
  154 + @RequestMapping(value = "/exportXls")
  155 + public ModelAndView exportXls(HttpServletRequest request, ShipmentContainerAdvice shipmentContainerAdvice) {
  156 + return super.exportXls(request, shipmentContainerAdvice, ShipmentContainerAdvice.class, "出库预配盘");
  157 + }
  158 +
  159 + /**
  160 + * 通过excel导入数据
  161 + *
  162 + * @param request
  163 + * @param response
  164 + * @return
  165 + */
  166 + @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
  167 + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
  168 + return super.importExcel(request, response, ShipmentContainerAdvice.class);
  169 + }
  170 +
  171 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/entity/ShipmentContainerAdvice.java 0 → 100644
  1 +package org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +import org.jeecgframework.poi.excel.annotation.Excel;
  6 +
  7 +import com.baomidou.mybatisplus.annotation.IdType;
  8 +import com.baomidou.mybatisplus.annotation.TableId;
  9 +import com.baomidou.mybatisplus.annotation.TableName;
  10 +
  11 +import io.swagger.annotations.ApiModel;
  12 +import io.swagger.annotations.ApiModelProperty;
  13 +import lombok.Data;
  14 +import lombok.EqualsAndHashCode;
  15 +import lombok.experimental.Accessors;
  16 +
  17 +/**
  18 + * @Description: 出库预配盘
  19 + * @Author: jeecg-boot
  20 + * @Date: 2023-11-16
  21 + * @Version: V1.0
  22 + */
  23 +@Data
  24 +@TableName("shipment_container_advice")
  25 +@Accessors(chain = true)
  26 +@EqualsAndHashCode(callSuper = false)
  27 +@ApiModel(value = "shipment_container_advice对象", description = "出库预配盘")
  28 +public class ShipmentContainerAdvice implements Serializable {
  29 + private static final long serialVersionUID = 1L;
  30 +
  31 + /** 主键 */
  32 + @TableId(type = IdType.AUTO)
  33 + @ApiModelProperty(value = "主键")
  34 + private Integer id;
  35 + /** 仓库编码 */
  36 + @Excel(name = "仓库编码", width = 15)
  37 + @ApiModelProperty(value = "仓库编码")
  38 + private java.lang.String warehouseCode;
  39 + /** 容器编码 */
  40 + @Excel(name = "容器编码", width = 15)
  41 + @ApiModelProperty(value = "容器编码")
  42 + private java.lang.String containerCode;
  43 + /** 库位编码 */
  44 + @Excel(name = "库位编码", width = 15)
  45 + @ApiModelProperty(value = "库位编码")
  46 + private java.lang.String locationCode;
  47 + /** 库存明细id */
  48 + @Excel(name = "库存明细id", width = 15)
  49 + @ApiModelProperty(value = "库存明细id")
  50 + private java.lang.Integer inventoryDetailId;
  51 + /** 出库配盘ID */
  52 + @Excel(name = "出库配盘ID", width = 15)
  53 + @ApiModelProperty(value = "出库配盘ID")
  54 + private java.lang.Integer shipmentContainerId;
  55 + /** 出库单编码 */
  56 + @Excel(name = "出库单编码", width = 15)
  57 + @ApiModelProperty(value = "出库单编码")
  58 + private java.lang.String shipmentCode;
  59 + /** 出库单ID */
  60 + @Excel(name = "出库单ID", width = 15)
  61 + @ApiModelProperty(value = "出库单ID")
  62 + private java.lang.Integer shipmentId;
  63 + /** 出库明细id */
  64 + @Excel(name = "出库明细id", width = 15)
  65 + @ApiModelProperty(value = "出库明细id")
  66 + private java.lang.Integer shipmentDetailId;
  67 + /** 货主 */
  68 + @Excel(name = "货主", width = 15)
  69 + @ApiModelProperty(value = "货主")
  70 + private java.lang.String companyCode;
  71 + /** 物料编码 */
  72 + @Excel(name = "物料编码", width = 15)
  73 + @ApiModelProperty(value = "物料编码")
  74 + private java.lang.String materialCode;
  75 + /** 物料名称 */
  76 + @Excel(name = "物料名称", width = 15)
  77 + @ApiModelProperty(value = "物料名称")
  78 + private java.lang.String materialName;
  79 + /** 物料规格 */
  80 + @Excel(name = "物料规格", width = 15)
  81 + @ApiModelProperty(value = "物料规格")
  82 + private java.lang.String materialSpec;
  83 + /** 物料单位 */
  84 + @Excel(name = "物料单位", width = 15)
  85 + @ApiModelProperty(value = "物料单位")
  86 + private java.lang.String materialUnit;
  87 + /** 批次 */
  88 + @Excel(name = "批次", width = 15)
  89 + @ApiModelProperty(value = "批次")
  90 + private java.lang.String batch;
  91 + /** 状态 */
  92 + @Excel(name = "状态", width = 15)
  93 + @ApiModelProperty(value = "状态")
  94 + private java.lang.Integer status;
  95 + /** 数量 */
  96 + @Excel(name = "数量", width = 15)
  97 + @ApiModelProperty(value = "数量")
  98 + private java.math.BigDecimal qty;
  99 + /** 创建人 */
  100 + @ApiModelProperty(value = "创建人")
  101 + private java.lang.String createBy;
  102 + /** 创建日期 */
  103 + @ApiModelProperty(value = "创建日期")
  104 + private java.util.Date createTime;
  105 + /** 更新人 */
  106 + @ApiModelProperty(value = "更新人")
  107 + private java.lang.String updateBy;
  108 + /** 更新日期 */
  109 + @ApiModelProperty(value = "更新日期")
  110 + private java.util.Date updateTime;
  111 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/mapper/ShipmentContainerAdviceMapper.java 0 → 100644
  1 +package org.jeecg.modules.wms.shipment.shipmentContainerAdvice.mapper;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.apache.ibatis.annotations.Param;
  6 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice;
  7 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  8 +
  9 +/**
  10 + * @Description: 出库预配盘
  11 + * @Author: jeecg-boot
  12 + * @Date: 2023-11-16
  13 + * @Version: V1.0
  14 + */
  15 +public interface ShipmentContainerAdviceMapper extends BaseMapper<ShipmentContainerAdvice> {
  16 +
  17 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/mapper/xml/ShipmentContainerAdviceMapper.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.shipment.shipmentContainerAdvice.mapper.ShipmentContainerAdviceMapper">
  4 +
  5 +</mapper>
0 6 \ No newline at end of file
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/service/IShipmentContainerAdviceService.java 0 → 100644
  1 +package org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service;
  2 +
  3 +import java.math.BigDecimal;
  4 +import java.util.List;
  5 +
  6 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice;
  7 +
  8 +import com.baomidou.mybatisplus.extension.service.IService;
  9 +
  10 +/**
  11 + * @Description: 出库预配盘
  12 + * @Author: jeecg-boot
  13 + * @Date: 2023-11-16
  14 + * @Version: V1.0
  15 + */
  16 +public interface IShipmentContainerAdviceService extends IService<ShipmentContainerAdvice> {
  17 +
  18 + boolean updateQtyById(BigDecimal qty, int id);
  19 +
  20 + List<ShipmentContainerAdvice> getShipmentContainerAdviceListByShipmentCode(String shipmentCode, String warehouseCode);
  21 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/service/impl/ShipmentContainerAdviceServiceImpl.java 0 → 100644
  1 +package org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.impl;
  2 +
  3 +import java.math.BigDecimal;
  4 +import java.util.List;
  5 +
  6 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice;
  7 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.mapper.ShipmentContainerAdviceMapper;
  8 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.IShipmentContainerAdviceService;
  9 +import org.springframework.stereotype.Service;
  10 +
  11 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  12 +
  13 +/**
  14 + * @Description: 出库预配盘
  15 + * @Author: jeecg-boot
  16 + * @Date: 2023-11-16
  17 + * @Version: V1.0
  18 + */
  19 +@Service
  20 +public class ShipmentContainerAdviceServiceImpl extends ServiceImpl<ShipmentContainerAdviceMapper, ShipmentContainerAdvice>
  21 + implements IShipmentContainerAdviceService {
  22 +
  23 + @Override
  24 + public boolean updateQtyById(BigDecimal qty, int id) {
  25 + return false;
  26 + }
  27 +
  28 + @Override
  29 + public List<ShipmentContainerAdvice> getShipmentContainerAdviceListByShipmentCode(String shipmentCode, String warehouseCode) {
  30 + return null;
  31 + }
  32 +
  33 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/IShipmentContainerHeaderService.java
... ... @@ -30,6 +30,11 @@ public interface IShipmentContainerHeaderService extends IService&lt;ShipmentContai
30 30  
31 31 public List<ShipmentContainerHeader> getUnCompleteCombineList();
32 32  
  33 + /**
  34 + * 根据托盘号找到生成任务状态的出库配盘头
  35 + */
  36 + public List<ShipmentContainerHeader> getNotCombineList();
  37 +
33 38 boolean havaUnCompleteCombineByContainerCode(String containerCode, String warehouseCode);
34 39  
35 40 boolean havaUnCompleteCombineByLocationCode(String locationCode, String warehouseCode);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/impl/ShipmentContainerHeaderServiceImpl.java
... ... @@ -95,6 +95,14 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
95 95 }
96 96  
97 97 @Override
  98 + public List<ShipmentContainerHeader> getNotCombineList() {
  99 + LambdaQueryWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
  100 + shipmentContainerHeaderLambdaQueryWrapper.eq(ShipmentContainerHeader::getStatus, QuantityConstant.SHIPMENT_CONTAINER_TASK);
  101 + List<ShipmentContainerHeader> shipmentContainerHeaderList = list(shipmentContainerHeaderLambdaQueryWrapper);
  102 + return shipmentContainerHeaderList;
  103 + }
  104 +
  105 + @Override
98 106 public boolean havaUnCompleteCombineByContainerCode(String containerCode, String warehouseCode) {
99 107 LambdaQueryWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
100 108 shipmentContainerHeaderLambdaQueryWrapper.eq(ShipmentContainerHeader::getContainerCode, containerCode)
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... ... @@ -155,7 +155,7 @@ public class ShipmentHeaderController extends JeecgController&lt;ShipmentHeader, IS
155 155 @ApiOperation(value = "出库单-通过id删除", notes = "出库单-通过id删除")
156 156 @DeleteMapping(value = "/delete")
157 157 public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
158   - shipmentHeaderService.delMain(id);
  158 + shipmentHeaderService.delMain(id, "删除出库单");
159 159 return Result.OK("删除成功!");
160 160 }
161 161  
... ... @@ -422,9 +422,19 @@ public class ShipmentHeaderController extends JeecgController&lt;ShipmentHeader, IS
422 422 @ResponseBody
423 423 public Result<TaskHeader> autoShipment(@RequestBody ShipmentHeader shipmentHeader, HttpServletRequest req) {
424 424 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
425   - String toPort = shipmentHeader.getToPort();
426 425 String shipmentCode = shipmentHeader.getCode();
427   - Result result = huahengMultiHandlerService.autoShipment(shipmentCode, toPort, warehouseCode);
  426 + Result result = huahengMultiHandlerService.autoShipment(shipmentCode, warehouseCode);
  427 + return result;
  428 + }
  429 +
  430 + @AutoLog(value = "自动预配盘出库")
  431 + @ApiOperation(value = "自动预配盘出库", notes = "自动预配盘出库")
  432 + @PostMapping("/autoShipmentAdvice")
  433 + @ResponseBody
  434 + public Result<TaskHeader> autoShipmentAdvice(@RequestBody ShipmentHeader shipmentHeader, HttpServletRequest req) {
  435 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  436 + String shipmentCode = shipmentHeader.getCode();
  437 + Result result = huahengMultiHandlerService.autoShipmentAdvice(shipmentCode, warehouseCode);
428 438 return result;
429 439 }
430 440 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/IShipmentHeaderService.java
... ... @@ -20,7 +20,7 @@ public interface IShipmentHeaderService extends IService&lt;ShipmentHeader&gt; {
20 20 /**
21 21 * 删除一对多
22 22 */
23   - public boolean delMain(String id);
  23 + public boolean delMain(String id, String reason);
24 24  
25 25 /**
26 26 * 批量删除一对多
... ... @@ -43,5 +43,7 @@ public interface IShipmentHeaderService extends IService&lt;ShipmentHeader&gt; {
43 43  
44 44 public Result<Object> mergeShipment(List<ShipmentHeader> shipmentHeaderList);
45 45  
46   - Result autoShipment(String shipmentCode, String toPort, String warehouseCode);
  46 + Result autoShipment(String shipmentCode, String warehouseCode);
  47 +
  48 + Result autoShipmentAdvice(String shipmentCode, String warehouseCode);
47 49 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... ... @@ -25,6 +25,8 @@ import org.jeecg.modules.wms.config.zone.service.IZoneService;
25 25 import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService;
26 26 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
27 27 import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService;
  28 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice;
  29 +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.IShipmentContainerAdviceService;
28 30 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail;
29 31 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
30 32 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService;
... ... @@ -107,15 +109,17 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
107 109 private IPortService portService;
108 110 @Resource
109 111 private IZoneService zoneService;
  112 + @Resource
  113 + private IShipmentContainerAdviceService shipmentContainerAdviceService;
110 114  
111 115 @Override
112 116 @Transactional
113   - public boolean delMain(String id) {
  117 + public boolean delMain(String id, String reason) {
114 118 ShipmentHeader shipmentHeader = getById(id);
115 119 if (shipmentHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) {
116 120 throw new JeecgBootException("不能删除非新建状态单据");
117 121 }
118   - shipmentHeaderHistoryService.saveById(id);
  122 + shipmentHeaderHistoryService.saveById(id, reason);
119 123 shipmentDetailMapper.deleteByMainId(id.toString());
120 124 shipmentHeaderMapper.deleteById(id);
121 125 return true;
... ... @@ -125,7 +129,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
125 129 @Transactional
126 130 public void delBatchMain(Collection<? extends Serializable> idList) {
127 131 for (Serializable id : idList) {
128   - this.delMain(id.toString());
  132 + this.delMain(id.toString(), "批量删除");
129 133 }
130 134 }
131 135  
... ... @@ -351,32 +355,23 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
351 355 return Result.OK("合并成功");
352 356 }
353 357  
  358 + /**
  359 + * 自动出库
  360 + */
354 361 @Override
355 362 @Transactional(rollbackFor = JeecgBootException.class)
356   - public Result autoShipment(String shipmentCode, String toPort, String warehouseCode) {
  363 + public Result autoShipment(String shipmentCode, String warehouseCode) {
357 364 if (StringUtils.isEmpty(shipmentCode)) {
358 365 return Result.error("自动出库, 出库单编码为空");
359 366 }
360   -// if (StringUtils.isEmpty(toPort)) {
361   -// return Result.error("自动出库, 出库口为空");
362   -// }
363 367 if (StringUtils.isEmpty(warehouseCode)) {
364 368 return Result.error("自动出库, 仓库编码为空");
365 369 }
366   -// Port port = portService.getPortByCode(toPort, warehouseCode);
367   -// if (port == null) {
368   -// return Result.error("自动出库, 没有找到出库口");
369   -// }
370   -// int type = Integer.parseInt(port.getType());
371   -// if (type == QuantityConstant.PORT_TYPE_IN) {
372   -// return Result.error("自动出库, 不能选择入库口来出库");
373   -// }
374 370 ShipmentHeader shipmentHeader = shipmentHeaderService.getShipmentHeaderByCode(shipmentCode, warehouseCode);
375 371 if (shipmentHeader == null) {
376 372 throw new JeecgBootException("自动出库, 没有找到出库单");
377 373 }
378 374 String zoneCode = shipmentHeader.getZoneCode();
379   -
380 375 if (StringUtils.isEmpty(zoneCode)) {
381 376 throw new JeecgBootException("自动出库, 库区编码为空");
382 377 }
... ... @@ -396,7 +391,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
396 391 throw new JeecgBootException("自动出库," + result.getMessage());
397 392 }
398 393 List<ShipmentContainerDetail> shipmentContainerDetailList = shipmentContainerDetailService.getShipmentContainerDetailListByShipmentCode(shipmentCode);
399   - if (shipmentContainerDetailList == null) {
  394 + if (CollectionUtils.isEmpty(shipmentContainerDetailList)) {
400 395 throw new JeecgBootException("自动出库, 没有找到出库配盘详情");
401 396 }
402 397 List<Integer> shipmentContainerIdList =
... ... @@ -449,4 +444,95 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
449 444 }
450 445 return Result.OK("自动出库成功");
451 446 }
  447 +
  448 + /**
  449 + * 自动预配盘出库
  450 + */
  451 + @Override
  452 + @Transactional(rollbackFor = JeecgBootException.class)
  453 + public Result autoShipmentAdvice(String shipmentCode, String warehouseCode) {
  454 + if (StringUtils.isEmpty(shipmentCode)) {
  455 + return Result.error("自动预配盘出库, 出库单编码为空");
  456 + }
  457 + if (StringUtils.isEmpty(warehouseCode)) {
  458 + return Result.error("自动预配盘出库, 仓库编码为空");
  459 + }
  460 + ShipmentHeader shipmentHeader = shipmentHeaderService.getShipmentHeaderByCode(shipmentCode, warehouseCode);
  461 + if (shipmentHeader == null) {
  462 + throw new JeecgBootException("自动预配盘出库, 没有找到出库单");
  463 + }
  464 + String zoneCode = shipmentHeader.getZoneCode();
  465 + if (StringUtils.isEmpty(zoneCode)) {
  466 + throw new JeecgBootException("自动预配盘出库, 库区编码为空");
  467 + }
  468 + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode);
  469 + if (zone == null) {
  470 + throw new JeecgBootException("自动预配盘出库, 库区为空");
  471 + }
  472 + String zoneType = zone.getType();
  473 + if (StringUtils.isEmpty(zoneType)) {
  474 + throw new JeecgBootException("自动预配盘出库, 库区类型编码为空");
  475 + }
  476 + if (!zoneType.equals(QuantityConstant.ZONE_TYPE_STEREOSCOPIC)) {
  477 + throw new JeecgBootException("自动预配盘出库, 库区类型必须为立库区类型");
  478 + }
  479 + Result result = shipmentCombinationService.autoCombination(shipmentCode, true, warehouseCode);
  480 + if (!result.isSuccess()) {
  481 + throw new JeecgBootException("自动预配盘出库," + result.getMessage());
  482 + }
  483 + List<ShipmentContainerAdvice> shipmentContainerAdviceList =
  484 + shipmentContainerAdviceService.getShipmentContainerAdviceListByShipmentCode(shipmentCode, warehouseCode);
  485 + if (CollectionUtils.isEmpty(shipmentContainerAdviceList)) {
  486 + throw new JeecgBootException("自动预配盘出库, 没有找到出库配盘详情");
  487 + }
  488 + List<Integer> shipmentContainerIdList =
  489 + shipmentContainerAdviceList.stream().map(ShipmentContainerAdvice::getShipmentContainerId).distinct().collect(Collectors.toList());
  490 + long shipmentOrder = System.currentTimeMillis();
  491 + int sequenceNumber = shipmentContainerIdList.size();
  492 + int sequence = 0;
  493 + for (int shipmentContainerId : shipmentContainerIdList) {
  494 + sequence++;
  495 + ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(shipmentContainerId);
  496 + if (shipmentContainerHeader == null) {
  497 + throw new JeecgBootException("自动出库, 没有找到出库表头:" + shipmentContainerId);
  498 + }
  499 + int taskType = shipmentContainerHeader.getTaskType();
  500 + int type = QuantityConstant.PORT_TYPE_PICK;
  501 + if (taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT) {
  502 + type = QuantityConstant.PORT_TYPE_OUT;
  503 + }
  504 + String fromLocationCode = shipmentContainerHeader.getFromLocationCode();
  505 + if (StringUtils.isEmpty(fromLocationCode)) {
  506 + throw new JeecgBootException("自动出库, 没有起始库位编码");
  507 + }
  508 + Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
  509 + if (fromLocation == null) {
  510 + throw new JeecgBootException("自动出库, 没有起始库位" + fromLocationCode);
  511 + }
  512 + Integer roadWay = fromLocation.getRoadWay();
  513 + List<Port> portList = portService.getPortListByType(type, roadWay, zoneCode, warehouseCode);
  514 + if (portList == null) {
  515 + throw new JeecgBootException("自动出库, 没有合适的出库口");
  516 + }
  517 + Port port = portList.get(0);
  518 + shipmentContainerHeader.setToPort(port.getCode());
  519 + boolean success = shipmentContainerHeaderService.updateById(shipmentContainerHeader);
  520 + if (!success) {
  521 + throw new JeecgBootException("自动出库, 更新出库组盘头失败");
  522 + }
  523 + result = huahengMultiHandlerService.createShipmentTask(shipmentContainerHeader, warehouseCode, shipmentOrder, sequence, sequenceNumber);
  524 + if (!result.isSuccess()) {
  525 + throw new JeecgBootException("自动出库, " + result.getMessage());
  526 + }
  527 + String containerCode = shipmentContainerHeader.getContainerCode();
  528 + if (StringUtils.isEmpty(containerCode)) {
  529 + throw new JeecgBootException("自动出库, 容器号为空");
  530 + }
  531 + TaskHeader taskHeader = taskHeaderService.getUnCompleteTaskByContainerCode(containerCode, warehouseCode);
  532 + if (taskHeader == null) {
  533 + throw new JeecgBootException("自动出库, 没有找到容器号对应任务" + containerCode);
  534 + }
  535 + }
  536 + return Result.OK("自动出库成功");
  537 + }
452 538 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeaderHistory/entity/ShipmentHeaderHistory.java
1 1 package org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity;
2 2  
3 3 import java.io.Serializable;
4   -import java.io.UnsupportedEncodingException;
5 4 import java.util.Date;
  5 +
  6 +import org.jeecg.common.aspect.annotation.Dict;
  7 +import org.jeecgframework.poi.excel.annotation.Excel;
  8 +import org.springframework.format.annotation.DateTimeFormat;
  9 +
6 10 import com.baomidou.mybatisplus.annotation.IdType;
7 11 import com.baomidou.mybatisplus.annotation.TableId;
8 12 import com.baomidou.mybatisplus.annotation.TableName;
9   -import org.jeecgframework.poi.excel.annotation.Excel;
10   -import lombok.Data;
11 13 import com.fasterxml.jackson.annotation.JsonFormat;
12   -import org.springframework.format.annotation.DateTimeFormat;
13   -import org.jeecg.common.aspect.annotation.Dict;
  14 +
14 15 import io.swagger.annotations.ApiModel;
15 16 import io.swagger.annotations.ApiModelProperty;
  17 +import lombok.Data;
16 18  
17 19 /**
18 20 * @Description: 历史出库单
... ... @@ -76,6 +78,10 @@ public class ShipmentHeaderHistory implements Serializable {
76 78 @Excel(name = "出库单备注", width = 15)
77 79 @ApiModelProperty(value = "出库单备注")
78 80 private String remark;
  81 + /** 来源信息 */
  82 + @Excel(name = "来源信息", width = 15)
  83 + @ApiModelProperty(value = "来源信息")
  84 + private String reason;
79 85 /** 备用字段1 */
80 86 @Excel(name = "备用字段1", width = 15)
81 87 @ApiModelProperty(value = "备用字段1")
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeaderHistory/service/IShipmentHeaderHistoryService.java
1 1 package org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service;
2 2  
3   -import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentDetailHistory;
4   -import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentHeaderHistory;
5   -import com.baomidou.mybatisplus.extension.service.IService;
6   -import org.springframework.beans.factory.annotation.Autowired;
7 3 import java.io.Serializable;
8 4 import java.util.Collection;
9   -import java.util.List;
  5 +
  6 +import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentHeaderHistory;
  7 +
  8 +import com.baomidou.mybatisplus.extension.service.IService;
10 9  
11 10 /**
12 11 * @Description: 历史出库单
... ... @@ -30,5 +29,5 @@ public interface IShipmentHeaderHistoryService extends IService&lt;ShipmentHeaderHi
30 29 * 根据删除的出库单主表ID新增历史出库单记录
31 30 * @param id
32 31 */
33   - void saveById(String id);
  32 + void saveById(String id, String reason);
34 33 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeaderHistory/service/impl/ShipmentHeaderHistoryServiceImpl.java
... ... @@ -69,10 +69,11 @@ public class ShipmentHeaderHistoryServiceImpl extends ServiceImpl&lt;ShipmentHeader
69 69 * @param id
70 70 */
71 71 @Override
72   - public void saveById(String id) {
  72 + public void saveById(String id, String reason) {
73 73 ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id);
74 74 ShipmentHeaderHistory shipmentHeaderHistory = new ShipmentHeaderHistory();
75 75 BeanUtils.copyProperties(shipmentHeader, shipmentHeaderHistory);
  76 + shipmentHeaderHistory.setReason(reason);
76 77 shipmentHeaderHistoryMapper.insert(shipmentHeaderHistory);
77 78 List<ShipmentDetail> shipmentDetailList =
78 79 shipmentDetailService.list(new LambdaQueryWrapper<ShipmentDetail>().eq(ShipmentDetail::getShipmentId, shipmentHeader.getId()));
... ...
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... ... @@ -2,22 +2,7 @@ package org.jeecg.utils.constant;
2 2  
3 3 /**
4 4 * 数字自定义常量
5   - * 1、入库单状态
6   - * 2、出库单状态
7   - * 3、单据上传状态
8   - * 4、入库组盘状态
9   - * 5、出库组盘状态
10   - * 6、任务类型
11   - * 7、任务状态
12   - * 8、波次状态
13   - * 9、质检状态
14   - * 10、盘点状态
15   - * 11、库存交易记录
16   - * 12、调整单状态
17   - * 13、任务内部类型
18   - * 14、质检单类型
19   - * 16、请求类型
20   - * @author ricard
  5 + * @author 游杰
21 6 */
22 7 public class QuantityConstant {
23 8  
... ...