Commit ebee70b3f6935bb2d7c0c7f0b6e331ed3e537ddf

Authored by 肖超群
2 parents 273376ab dab15ea3

Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms4 into develop

# Conflicts:
#	huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
Showing 32 changed files with 1153 additions and 70 deletions
ant-design-vue-jeecg/src/components/tools/HeaderNotice.vue
... ... @@ -6,7 +6,7 @@
6 6 :arrowPointAtCenter="true"
7 7 overlayClassName="header-notice-wrapper"
8 8 @visibleChange="handleHoverChange"
9   - :overlayStyle="{ width: '350px', top: '50px' }">
  9 + :overlayStyle="{ width: '300px', top: '50px' }">
10 10 <template slot="content">
11 11 <a-spin :spinning="loadding">
12 12 <a-tabs>
... ...
ant-design-vue-jeecg/src/views/system/UserList.vue
... ... @@ -94,11 +94,11 @@
94 94 </div>
95 95  
96 96 <a-table
97   - :scroll="{x: 1200}"
98 97 ref="table"
99   - bordered
100 98 size="middle"
  99 + bordered
101 100 rowKey="id"
  101 + :scroll="{x:true}"
102 102 :columns="columns"
103 103 :dataSource="dataSource"
104 104 :pagination="ipagination"
... ... @@ -261,8 +261,7 @@ export default {
261 261 align: "center",
262 262 dataIndex: 'selectedRoleList',
263 263 key: 'selectedRoleList',
264   - scopedSlots: {customRender: 'selectedRoleList'},
265   - width: 200
  264 + scopedSlots: {customRender: 'selectedRoleList'}
266 265 },
267 266 // {
268 267 // title: '生日',
... ... @@ -285,16 +284,14 @@ export default {
285 284 align: "center",
286 285 dataIndex: 'selectedWarehouses',
287 286 key: 'selectedWarehouses',
288   - scopedSlots: {customRender: 'selectedWarehouses'},
289   - width: 200
  287 + scopedSlots: {customRender: 'selectedWarehouses'}
290 288 },
291 289 {
292 290 title: '所属库区',
293 291 align: "center",
294 292 dataIndex: 'zoneCodes',
295 293 key: 'zoneCodes',
296   - scopedSlots: {customRender: 'zoneCodes'},
297   - width: 200
  294 + scopedSlots: {customRender: 'zoneCodes'}
298 295 },
299 296 // {
300 297 // title: '部门',
... ...
ant-design-vue-jeecg/src/views/system/config/ParameterConfigurationList.vue
... ... @@ -96,7 +96,6 @@
96 96 :pagination="ipagination"
97 97 :loading="loading"
98 98 :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
99   - class="j-table-force-nowrap"
100 99 @change="handleTableChange">
101 100  
102 101 <span slot="zoneCode" slot-scope="zoneCode">
... ... @@ -202,12 +201,14 @@ export default {
202 201 {
203 202 title: '参数键值',
204 203 align: "center",
205   - dataIndex: 'value'
  204 + dataIndex: 'value',
  205 + width: 200,
206 206 },
207 207 {
208 208 title: '备注',
209 209 align: "center",
210   - dataIndex: 'remark'
  210 + dataIndex: 'remark',
  211 + width: 300
211 212 },
212 213 {
213 214 title: '创建人',
... ...
ant-design-vue-jeecg/src/views/system/lockStation/LockStationList.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-row :gutter="24">
  8 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  9 + <a-form-item label="站台">
  10 + <j-input placeholder="请输入站台" v-model="queryParam.code"></j-input>
  11 + </a-form-item>
  12 + </a-col>
  13 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  14 + <a-form-item label="任务号">
  15 + <a-input placeholder="请输入任务号" v-model="queryParam.taskId"></a-input>
  16 + </a-form-item>
  17 + </a-col>
  18 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19 + <a-form-item label="状态">
  20 + <j-dict-select-tag placeholder="请选择状态" v-model="queryParam.status" dictCode="port_lock_status"/>
  21 + </a-form-item>
  22 + </a-col>
  23 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  24 + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  25 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  26 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  27 + </span>
  28 + </a-col>
  29 + </a-row>
  30 + </a-row>
  31 + </a-form>
  32 + </div>
  33 + <!-- 查询区域-END -->
  34 +
  35 + <!-- 操作按钮区域 -->
  36 + <div class="table-operator">
  37 + <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  38 + <a-dropdown v-if="selectedRowKeys.length > 0">
  39 + <a-menu slot="overlay">
  40 + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  41 + </a-menu>
  42 + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  43 + </a-dropdown>
  44 + </div>
  45 +
  46 + <!-- table区域-begin -->
  47 + <div>
  48 + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  49 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  50 + <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  51 + </div>
  52 +
  53 + <a-table
  54 + ref="table"
  55 + size="middle"
  56 + :scroll="{x:true}"
  57 + bordered
  58 + rowKey="id"
  59 + :columns="columns"
  60 + :dataSource="dataSource"
  61 + :pagination="ipagination"
  62 + :loading="loading"
  63 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  64 + class="j-table-force-nowrap"
  65 + @change="handleTableChange">
  66 +
  67 + <template slot="htmlSlot" slot-scope="text">
  68 + <div v-html="text"></div>
  69 + </template>
  70 + <template slot="imgSlot" slot-scope="text">
  71 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  72 + <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  73 + </template>
  74 + <template slot="fileSlot" slot-scope="text">
  75 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  76 + <a-button
  77 + v-else
  78 + :ghost="true"
  79 + type="primary"
  80 + icon="download"
  81 + size="small"
  82 + @click="downloadFile(text)">
  83 + 下载
  84 + </a-button>
  85 + </template>
  86 +
  87 + <span slot="action" slot-scope="text, record">
  88 + <a @click="handleEdit(record)">编辑</a>
  89 +
  90 + <a-divider type="vertical" />
  91 + <a-dropdown>
  92 + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  93 + <a-menu slot="overlay">
  94 + <a-menu-item>
  95 + <a @click="handleDetail(record)">详情</a>
  96 + </a-menu-item>
  97 + <a-menu-item>
  98 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  99 + <a>删除</a>
  100 + </a-popconfirm>
  101 + </a-menu-item>
  102 + </a-menu>
  103 + </a-dropdown>
  104 + </span>
  105 +
  106 + </a-table>
  107 + </div>
  108 +
  109 + <lock-station-modal ref="modalForm" @ok="modalFormOk"></lock-station-modal>
  110 + </a-card>
  111 +</template>
  112 +
  113 +<script>
  114 +
  115 + import '@/assets/less/TableExpand.less'
  116 + import { mixinDevice } from '@/utils/mixin'
  117 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  118 + import LockStationModal from './modules/LockStationModal'
  119 +
  120 + export default {
  121 + name: 'LockStationList',
  122 + mixins:[JeecgListMixin, mixinDevice],
  123 + components: {
  124 + LockStationModal
  125 + },
  126 + data () {
  127 + return {
  128 + description: '锁定站台管理页面',
  129 + // 表头
  130 + columns: [
  131 + {
  132 + title: '#',
  133 + dataIndex: '',
  134 + key:'rowIndex',
  135 + width:60,
  136 + align:"center",
  137 + customRender:function (t,r,index) {
  138 + return parseInt(index)+1;
  139 + }
  140 + },
  141 + {
  142 + title:'仓库',
  143 + align:"center",
  144 + dataIndex: 'warehouseCode'
  145 + },
  146 + {
  147 + title:'站台',
  148 + align:"center",
  149 + dataIndex: 'code'
  150 + },
  151 + {
  152 + title:'任务ID',
  153 + align:"center",
  154 + dataIndex: 'taskId'
  155 + },
  156 + {
  157 + title:'状态',
  158 + align:"center",
  159 + dataIndex: 'status_dictText'
  160 + },
  161 + {
  162 + title:'库区',
  163 + align:"center",
  164 + dataIndex: 'zoneCode'
  165 + },
  166 + {
  167 + title: '操作',
  168 + dataIndex: 'action',
  169 + align:"center",
  170 + fixed:"right",
  171 + width:147,
  172 + scopedSlots: { customRender: 'action' }
  173 + }
  174 + ],
  175 + url: {
  176 + list: "/lock/lockStation/list",
  177 + delete: "/lock/lockStation/delete",
  178 + deleteBatch: "/lock/lockStation/deleteBatch",
  179 + exportXlsUrl: "/lock/lockStation/exportXls",
  180 + importExcelUrl: "lock/lockStation/importExcel",
  181 +
  182 + },
  183 + dictOptions:{},
  184 + superFieldList:[],
  185 + }
  186 + },
  187 + created() {
  188 + this.getSuperFieldList();
  189 + },
  190 + computed: {
  191 + importExcelUrl: function(){
  192 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  193 + },
  194 + },
  195 + methods: {
  196 + initDictConfig(){
  197 + },
  198 + getSuperFieldList(){
  199 + let fieldList=[];
  200 + fieldList.push({type:'string',value:'warehouseCode',text:'仓库',dictCode:''})
  201 + fieldList.push({type:'string',value:'code',text:'站台',dictCode:''})
  202 + fieldList.push({type:'string',value:'taskId',text:'任务ID',dictCode:''})
  203 + fieldList.push({type:'int',value:'status',text:'状态',dictCode:''})
  204 + fieldList.push({type:'string',value:'zoneCode',text:'库区',dictCode:''})
  205 + this.superFieldList = fieldList
  206 + }
  207 + }
  208 + }
  209 +</script>
  210 +<style scoped>
  211 + @import '~@assets/less/common.less';
  212 +</style>
0 213 \ No newline at end of file
... ...
ant-design-vue-jeecg/src/views/system/lockStation/modules/LockStationForm.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="warehouseCode">
  8 + <a-input v-model="model.warehouseCode" 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="code">
  13 + <j-search-select-tag
  14 + placeholder="请选择入库口"
  15 + v-model="model.code"
  16 + dict="port,name,code,type !='2'"
  17 + :pageSize="5"
  18 + :async="true">
  19 + </j-search-select-tag>
  20 + </a-form-model-item>
  21 + </a-col>
  22 + <a-col :span="24">
  23 + <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
  24 + <j-dict-select-tag v-model="model.status" title="状态" dictCode="port_lock_status" placeholder="请选择状态"/>
  25 + </a-form-model-item>
  26 + </a-col>
  27 + <a-col :span="24">
  28 + <a-form-model-item label="库区" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zoneCode">
  29 + <a-select
  30 + show-search
  31 + placeholder="请选择库区"
  32 + option-filter-prop="children"
  33 + v-model="model.zoneCode">
  34 + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{
  35 + item.name
  36 + }}
  37 + </a-select-option>
  38 + </a-select>
  39 + </a-form-model-item>
  40 + </a-col>
  41 + </a-row>
  42 + </a-form-model>
  43 + </j-form-container>
  44 + </a-spin>
  45 +</template>
  46 +
  47 +<script>
  48 +
  49 + import { httpAction, getAction } from '@/api/manage'
  50 + import { validateDuplicateValue } from '@/utils/util'
  51 + import {getZoneList} from '@/api/api'
  52 +
  53 + export default {
  54 + name: 'LockStationForm',
  55 + components: {
  56 + },
  57 + props: {
  58 + //表单禁用
  59 + disabled: {
  60 + type: Boolean,
  61 + default: false,
  62 + required: false
  63 + }
  64 + },
  65 + data () {
  66 + return {
  67 + model:{
  68 + },
  69 + labelCol: {
  70 + xs: { span: 24 },
  71 + sm: { span: 5 },
  72 + },
  73 + wrapperCol: {
  74 + xs: { span: 24 },
  75 + sm: { span: 16 },
  76 + },
  77 + confirmLoading: false,
  78 + validatorRules: {
  79 + code: [
  80 + {required: true, message: '请选择站台!'},
  81 + ],
  82 + status: [
  83 + {required: true, message: '请选择状态!'},
  84 + ],
  85 + },
  86 + url: {
  87 + add: "/lock/lockStation/add",
  88 + edit: "/lock/lockStation/edit",
  89 + queryById: "/lock/lockStation/queryById"
  90 + },
  91 + zoneList: []
  92 + }
  93 + },
  94 + computed: {
  95 + formDisabled(){
  96 + return this.disabled
  97 + },
  98 + },
  99 + created () {
  100 + //备份model原始值
  101 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  102 + this.loadFrom();
  103 + },
  104 + methods: {
  105 + add () {
  106 + this.edit(this.modelDefault);
  107 + },
  108 + edit (record) {
  109 + this.model = Object.assign({}, record);
  110 + this.visible = true;
  111 + },
  112 + loadFrom() {
  113 + getZoneList().then((res) => {
  114 + if (res.success) {
  115 + this.zoneList = res.result
  116 + }
  117 + });
  118 + },
  119 + submitForm () {
  120 + const that = this;
  121 + // 触发表单验证
  122 + this.$refs.form.validate(valid => {
  123 + if (valid) {
  124 + that.confirmLoading = true;
  125 + let httpurl = '';
  126 + let method = '';
  127 + if(!this.model.id){
  128 + httpurl+=this.url.add;
  129 + method = 'post';
  130 + }else{
  131 + httpurl+=this.url.edit;
  132 + method = 'put';
  133 + }
  134 + httpAction(httpurl,this.model,method).then((res)=>{
  135 + if(res.success){
  136 + that.$message.success(res.message);
  137 + that.$emit('ok');
  138 + }else{
  139 + that.$message.warning(res.message);
  140 + }
  141 + }).finally(() => {
  142 + that.confirmLoading = false;
  143 + })
  144 + }
  145 +
  146 + })
  147 + },
  148 + }
  149 + }
  150 +</script>
0 151 \ No newline at end of file
... ...
ant-design-vue-jeecg/src/views/system/lockStation/modules/LockStationModal.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 + <lock-station-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></lock-station-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 LockStationForm from './LockStationForm'
  21 +
  22 + export default {
  23 + name: 'LockStationModal',
  24 + components: {
  25 + LockStationForm
  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/lockStation/modules/LockStationModal.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 + <lock-station-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></lock-station-form>
  12 + </j-modal>
  13 +</template>
  14 +
  15 +<script>
  16 +
  17 + import LockStationForm from './LockStationForm'
  18 + export default {
  19 + name: 'LockStationModal',
  20 + components: {
  21 + LockStationForm
  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
... ...
ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerStatusSelectModal.vue
... ... @@ -24,6 +24,18 @@
24 24 />
25 25 </a-form-model-item>
26 26 </a-col>
  27 + <a-col :lg="15">
  28 + <a-form-model-item label="入库口">
  29 + <!-- <a-input placeholder="请输入入库口" v-model="quickMainModel.toPort"/>-->
  30 + <j-search-select-tag
  31 + placeholder="请选择入库口"
  32 + v-model="model.fromPort"
  33 + dict="port,name,code,type !='2'"
  34 + :pageSize="5"
  35 + :async="true">
  36 + </j-search-select-tag>
  37 + </a-form-model-item>
  38 + </a-col>
27 39 </a-row>
28 40 </a-form-model>
29 41 </a-spin>
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/message/websocket/WebSocket.java
... ... @@ -165,15 +165,15 @@ public class WebSocket {
165 165 * @param userId
166 166 * @param sysAnnouncement
167 167 */
168   - public void sendMessage(int userId, SysAnnouncement sysAnnouncement){
  168 + public void sendMessage(int userId, SysAnnouncement sysAnnouncement) {
169 169 sendMessage(String.valueOf(userId), createJson(sysAnnouncement));
170 170 }
171 171  
172   - public void sendMessage(List<SysUser> userList, SysAnnouncement announcement){
  172 + public void sendMessage(List<SysUser> userList, SysAnnouncement announcement) {
173 173 userList.forEach(user -> sendMessage(user.getId(), announcement));
174 174 }
175 175  
176   - private String createJson(SysAnnouncement announcement){
  176 + private String createJson(SysAnnouncement announcement) {
177 177 JSONObject obj = new JSONObject();
178 178 obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
179 179 obj.put(WebsocketConst.MSG_ID, announcement.getId());
... ... @@ -185,7 +185,7 @@ public class WebSocket {
185 185 * 广播系统消息
186 186 * @param sysAnnouncement
187 187 */
188   - public void sendMessage(SysAnnouncement sysAnnouncement){
  188 + public void sendMessage(SysAnnouncement sysAnnouncement) {
189 189 sendMessage(createJson(sysAnnouncement));
190 190 }
191 191  
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/LoginController.java
... ... @@ -197,8 +197,7 @@ public class LoginController {
197 197 loginUser.setId(sysUser.getId() + "");
198 198 baseCommonService.addLog("用户名:" + username + ",登录成功!", CommonConstant.LOG_TYPE_1, null, loginUser);
199 199 // update-end--Author:wangshuai Date:20200714 for:登录日志没有记录人员
200   -
201   - systemSync.sendSysAnnouncement(sysUser);
  200 +// systemSync.sendSysAnnouncement(sysUser);
202 201 return result;
203 202 }
204 203  
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/service/impl/MobileService.java
... ... @@ -98,6 +98,7 @@ public class MobileService implements IMobileService {
98 98 taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_SHIPMENT);
99 99 taskHeader.setTaskType(QuantityConstant.TASK_TYPE_SORTINGSHIPMENT);
100 100 }
  101 + taskHeader.setZoneCode(container.getZoneCode());
101 102 taskHeader.setCallBox(QuantityConstant.CALL_BOX);
102 103 taskHeader.setContainerCode(containerCode);
103 104 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java
... ... @@ -8,6 +8,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
8 8 import org.jeecg.modules.wms.api.wcs.entity.*;
9 9 import org.jeecg.modules.wms.api.wcs.service.WcsService;
10 10 import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
  11 +import org.jeecg.modules.wms.lockStation.service.ILockStationService;
11 12 import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
12 13 import org.jeecg.utils.StringUtils;
13 14 import org.jeecg.utils.interceptor.AccessLimit;
... ... @@ -30,6 +31,8 @@ public class WcsController extends HuahengBaseController {
30 31 private WcsService wcsService;
31 32 @Resource
32 33 private ITaskHeaderService taskHeaderService;
  34 + @Resource
  35 + private ILockStationService lockStationService;
33 36  
34 37 /**
35 38 ** WCS给的长,宽,高,重在有不同规格库位才有用,destination是区域, locationType库位类型
... ... @@ -258,4 +261,34 @@ public class WcsController extends HuahengBaseController {
258 261 });
259 262 return result;
260 263 }
  264 +
  265 + /**
  266 + ** 解锁站台
  267 + */
  268 + @AutoLog(value = "解锁站台")
  269 + @PostMapping("/removeLockStation")
  270 + @ApiOperation("解锁站台")
  271 + @ApiLogger(apiName = "解锁站台", from = "WCS")
  272 + public Result removeLockStation(@RequestBody WcsTaskLock wcsTaskLock, HttpServletRequest req) {
  273 + String warehouseCode = wcsTaskLock.getWarehouseCode();
  274 + String fromPort = wcsTaskLock.getFromPort();
  275 + if (StringUtils.isEmpty(warehouseCode)) {
  276 + return Result.error("解锁站台, 仓库号为空");
  277 + }
  278 + if (StringUtils.isEmpty(fromPort)) {
  279 + return Result.error("解锁站台, 站台为空");
  280 + }
  281 + String lockKey = warehouseCode;
  282 + Result result = handleMultiProcess("removeLockStation", lockKey, new MultiProcessListener() {
  283 +
  284 + @Override
  285 + public Result<?> doProcess() {
  286 + if (!lockStationService.unlockStation(fromPort, warehouseCode)) {
  287 + return Result.error("解锁失败");
  288 + }
  289 + return Result.ok("解锁成功");
  290 + }
  291 + });
  292 + return result;
  293 + }
261 294 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/WcsTaskLock.java 0 → 100644
  1 +package org.jeecg.modules.wms.api.wcs.entity;
  2 +
  3 +import lombok.Data;
  4 +
  5 +@Data
  6 +public class WcsTaskLock {
  7 +
  8 + private String fromPort;
  9 + private String warehouseCode;
  10 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wms/service/WmsServiceImpl.java
... ... @@ -13,11 +13,15 @@ import org.jeecg.modules.wms.api.erp.entity.*;
13 13 import org.jeecg.modules.wms.api.erp.service.IErpService;
14 14 import org.jeecg.modules.wms.api.wms.entity.WmsEntity;
15 15 import org.jeecg.modules.wms.api.wms.entity.WmsInventory;
  16 +import org.jeecg.modules.wms.config.container.entity.Container;
  17 +import org.jeecg.modules.wms.config.container.service.IContainerService;
  18 +import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
16 19 import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService;
17 20 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
18 21 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader;
19 22 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
20 23 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService;
  24 +import org.jeecg.modules.wms.lockStation.service.ILockStationService;
21 25 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
22 26 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
23 27 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
... ... @@ -56,35 +60,58 @@ public class WmsServiceImpl implements WmsService {
56 60  
57 61 @Resource
58 62 private ITaskHeaderService taskHeaderService;
  63 +
59 64 @Resource
60 65 private IReceiptContainerHeaderService receiptContainerHeaderService;
  66 +
61 67 @Resource
62 68 private WmsService wmsService;
  69 +
63 70 @Resource
64 71 private IErpService erpService;
  72 +
65 73 @Resource
66 74 private IReceiveService receiveService;
  75 +
67 76 @Resource
68 77 private IReceiptHeaderService receiptHeaderService;
  78 +
69 79 @Resource
70 80 private IReceiptDetailService receiptDetailService;
  81 +
71 82 @Resource
72 83 private IHuahengMultiHandlerService huahengMultiHandlerService;
  84 +
73 85 @Resource
74 86 private IShipmentHeaderService shipmentHeaderService;
  87 +
75 88 @Resource
76 89 private IShipmentDetailService shipmentDetailService;
  90 +
77 91 @Resource
78 92 private IShipmentCombinationService shipmentCombinationService;
  93 +
79 94 @Resource
80 95 private IShipmentContainerHeaderService shipmentContainerHeaderService;
  96 +
81 97 @Resource
82 98 private IShipmentContainerDetailService shipmentContainerDetailService;
  99 +
83 100 @Resource
84 101 private IInventoryDetailService inventoryDetailService;
  102 +
85 103 @Resource
86 104 private IInventoryHeaderService inventoryHeaderService;
87 105  
  106 + @Resource
  107 + private IContainerService containerService;
  108 +
  109 + @Resource
  110 + private IParameterConfigurationService parameterConfigurationService;
  111 +
  112 + @Resource
  113 + private ILockStationService lockStationService;
  114 +
88 115 @Override
89 116 @Transactional(rollbackFor = Exception.class)
90 117 public Result sendWmsTask(WmsEntity wmsEntity) {
... ... @@ -123,6 +150,14 @@ public class WmsServiceImpl implements WmsService {
123 150 String toPort = wmsEntity.getToPort();
124 151 String containerCode = wmsEntity.getContainerCode();
125 152 String referCode = wmsEntity.getTaskNo();
  153 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  154 + if (container == null) {
  155 + return Result.error("托盘:" + containerCode + " 信息为空");
  156 + }
  157 + String zoneCode = container.getZoneCode();
  158 + if (StringUtils.isEmpty(zoneCode)) {
  159 + return Result.error("容器没有配置库区,请配置!");
  160 + }
126 161 List<WmsInventory> wmsInventoryList = wmsEntity.getWmsInventoryList();
127 162 List<Receive> receiveList = new ArrayList<>();
128 163 if (wmsInventoryList == null) {
... ... @@ -194,6 +229,17 @@ public class WmsServiceImpl implements WmsService {
194 229 throw new JeecgBootException("WMS下发入库信息,更新入库任务失败");
195 230 }
196 231 }
  232 + if (wmsEntity.getTaskType() == QuantityConstant.TASK_TYPE_WHOLERECEIPT) {
  233 + String value = parameterConfigurationService.getValueByCode(QuantityConstant.START_LOCKING_STATION, zoneCode);
  234 + if (StringUtils.isNotEmpty(value)) {
  235 + int lockStation = Integer.parseInt(value);
  236 + if (lockStation == QuantityConstant.START_LOCK_STATION) {
  237 + if (!lockStationService.lockStation(toPort, warehouseCode)) {
  238 + throw new JeecgBootException("生成入库任务时,站台已经锁定:" + toPort);
  239 + }
  240 + }
  241 + }
  242 + }
197 243 return result;
198 244 }
199 245  
... ... @@ -292,7 +338,6 @@ public class WmsServiceImpl implements WmsService {
292 338 if (StringUtils.isEmpty(toPort)) {
293 339 return Result.error("WMS下发出库任务失败,没有找到出库口" + toPort);
294 340 }
295   -
296 341 InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode);
297 342 if (inventoryHeader == null) {
298 343 return Result.error("WMS下发出库任务失败, 没有找到托盘库存" + containerCode);
... ... @@ -330,7 +375,6 @@ public class WmsServiceImpl implements WmsService {
330 375 if (StringUtils.isEmpty(toPort)) {
331 376 return Result.error("WMS下发出库任务失败,没有找到出库口" + toPort);
332 377 }
333   -
334 378 List<InventoryDetail> inventoryDetailList = new ArrayList<>();
335 379 for (WmsInventory wmsInventory : wmsInventoryList) {
336 380 String materialCode = wmsInventory.getMaterialCode();
... ... @@ -365,8 +409,8 @@ public class WmsServiceImpl implements WmsService {
365 409 public Result createEmptyIn(WmsEntity wmsEntity) {
366 410 String warehouseCode = wmsEntity.getWarehouseCode();
367 411 String contaienrCode = wmsEntity.getContainerCode();
368   -
369   - Result result = taskHeaderService.createEmptyIn(contaienrCode, QuantityConstant.EMPTY_STRING, warehouseCode);
  412 + String toPort = wmsEntity.getToPort();
  413 + Result result = taskHeaderService.createEmptyIn(contaienrCode, QuantityConstant.EMPTY_STRING, warehouseCode, toPort);
370 414 return result;
371 415 }
372 416  
... ... @@ -376,7 +420,6 @@ public class WmsServiceImpl implements WmsService {
376 420 String warehouseCode = wmsEntity.getWarehouseCode();
377 421 String toPort = wmsEntity.getToPort();
378 422 String contaienrCode = wmsEntity.getContainerCode();
379   -
380 423 Result result = taskHeaderService.createEmptyOut(contaienrCode, toPort, warehouseCode);
381 424 return result;
382 425 }
... ... @@ -385,5 +428,4 @@ public class WmsServiceImpl implements WmsService {
385 428 public Result cancelTaskByUpstreamTaskNo(String taskNo) {
386 429 return taskHeaderService.cancelTaskByUpstreamTaskNo(taskNo);
387 430 }
388   -
389 431 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/controller/ParameterConfigurationController.java
... ... @@ -32,6 +32,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
32 32 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
33 33 import org.jeecg.common.system.base.controller.JeecgController;
34 34 import org.springframework.beans.factory.annotation.Autowired;
  35 +import org.springframework.cache.annotation.CacheEvict;
35 36 import org.springframework.web.bind.annotation.*;
36 37 import org.springframework.web.multipart.MultipartFile;
37 38 import org.springframework.web.multipart.MultipartHttpServletRequest;
... ... @@ -98,6 +99,7 @@ public class ParameterConfigurationController extends JeecgController&lt;ParameterC
98 99 @ApiOperation(value = "参数配置-编辑", notes = "参数配置-编辑")
99 100 @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
100 101 @RequiresPermissions("parameterConfiguration:edit")
  102 + @CacheEvict(value = "parameterConfigurationService", allEntries = true)
101 103 public Result<String> edit(@RequestBody ParameterConfiguration parameterConfiguration) {
102 104 parameterConfigurationService.updateById(parameterConfiguration);
103 105 return Result.OK("编辑成功!");
... ... @@ -112,6 +114,7 @@ public class ParameterConfigurationController extends JeecgController&lt;ParameterC
112 114 @ApiOperation(value = "参数配置-通过id删除", notes = "参数配置-通过id删除")
113 115 @DeleteMapping(value = "/delete")
114 116 @RequiresPermissions("parameterConfiguration:delete")
  117 + @CacheEvict(value = "parameterConfigurationService", allEntries = true)
115 118 public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
116 119 parameterConfigurationService.removeById(id);
117 120 return Result.OK("删除成功!");
... ... @@ -126,6 +129,7 @@ public class ParameterConfigurationController extends JeecgController&lt;ParameterC
126 129 @ApiOperation(value = "参数配置-批量删除", notes = "参数配置-批量删除")
127 130 @DeleteMapping(value = "/deleteBatch")
128 131 @RequiresPermissions("parameterConfiguration:deleteBatch")
  132 + @CacheEvict(value = "parameterConfigurationService", allEntries = true)
129 133 public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
130 134 this.parameterConfigurationService.removeByIds(Arrays.asList(ids.split(",")));
131 135 return Result.OK("批量删除成功!");
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/impl/ParameterConfigurationServiceImpl.java
... ... @@ -6,6 +6,7 @@ import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfi
6 6 import org.jeecg.modules.wms.config.parameterConfiguration.mapper.ParameterConfigurationMapper;
7 7 import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
8 8 import org.jeecg.utils.constant.QuantityConstant;
  9 +import org.springframework.cache.annotation.Cacheable;
9 10 import org.springframework.stereotype.Service;
10 11  
11 12 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
... ... @@ -19,15 +20,18 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
19 20 * @Version: V1.0
20 21 */
21 22 @Service
22   -public class ParameterConfigurationServiceImpl extends ServiceImpl<ParameterConfigurationMapper, ParameterConfiguration> implements IParameterConfigurationService {
  23 +public class ParameterConfigurationServiceImpl extends ServiceImpl<ParameterConfigurationMapper, ParameterConfiguration>
  24 + implements IParameterConfigurationService {
23 25  
24 26 @Resource
25 27 IParameterConfigurationService parameterConfigurationService;
26 28  
27 29 @Override
  30 + @Cacheable(value = "parameterConfigurationService#3600", key = "#root.methodName + '_' + #code", unless = "#result == null")
28 31 public String getValueByCode(String code) {
29 32 LambdaQueryWrapper<ParameterConfiguration> parameterConfigurationLambdaQueryWrapper = Wrappers.lambdaQuery();
30   - parameterConfigurationLambdaQueryWrapper.eq(ParameterConfiguration::getCode, code).eq(ParameterConfiguration::getZoneCode, QuantityConstant.EMPTY_STRING);
  33 + parameterConfigurationLambdaQueryWrapper.eq(ParameterConfiguration::getCode, code).eq(ParameterConfiguration::getZoneCode,
  34 + QuantityConstant.EMPTY_STRING);
31 35 ParameterConfiguration parameterConfiguration = getOne(parameterConfigurationLambdaQueryWrapper);
32 36 if (parameterConfiguration == null) {
33 37 return null;
... ... @@ -37,6 +41,7 @@ public class ParameterConfigurationServiceImpl extends ServiceImpl&lt;ParameterConf
37 41 }
38 42  
39 43 @Override
  44 + @Cacheable(value = "parameterConfigurationService#3600", key = "#root.methodName + '_' + #code + '_' + #zoneCode", unless = "#result == null")
40 45 public String getValueByCode(String code, String zoneCode) {
41 46 LambdaQueryWrapper<ParameterConfiguration> parameterConfigurationLambdaQueryWrapper = Wrappers.lambdaQuery();
42 47 parameterConfigurationLambdaQueryWrapper.eq(ParameterConfiguration::getCode, code).eq(ParameterConfiguration::getZoneCode, zoneCode);
... ... @@ -49,6 +54,7 @@ public class ParameterConfigurationServiceImpl extends ServiceImpl&lt;ParameterConf
49 54 }
50 55  
51 56 @Override
  57 + @Cacheable(value = "parameterConfigurationService#3600", key = "#root.methodName + '_' + #code + '_int'", unless = "#result == null")
52 58 public int getValueIntByCode(String code) {
53 59 LambdaQueryWrapper<ParameterConfiguration> parameterConfigurationLambdaQueryWrapper = Wrappers.lambdaQuery();
54 60 parameterConfigurationLambdaQueryWrapper.eq(ParameterConfiguration::getCode, code);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/controller/HuahengBaseController.java
... ... @@ -88,9 +88,9 @@ public class HuahengBaseController {
88 88 try {
89 89 log.info("[{}] 开始分布式事务 lockKey = {},获取锁耗时: {}ms", taskName, fullLockKey, endTime - startTime);
90 90 result = multiProcessListener.doProcess();
91   - } catch (Exception e) {
  91 + } catch (Throwable e) {
92 92 log.error("[{}] 执行分布式事务失败 lockKey = {},errorMessage = {}", taskName, fullLockKey, ExceptionUtil.getMessage(e), e);
93   - return Result.error(ExceptionUtil.getMessage(e));
  93 + return Result.error(ExceptionUtil.getSimpleMessage(e));
94 94 } finally {
95 95 redissonDistributedLocker.unlock(fullLockKey);
96 96 final long finishTime = SystemClock.now();
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/controller/LockStationController.java 0 → 100644
  1 +package org.jeecg.modules.wms.lockStation.controller;
  2 +
  3 +import java.util.Arrays;
  4 +import javax.servlet.http.HttpServletRequest;
  5 +import javax.servlet.http.HttpServletResponse;
  6 +import org.jeecg.common.api.vo.Result;
  7 +import org.jeecg.common.system.query.QueryGenerator;
  8 +import org.jeecg.modules.wms.lockStation.entity.LockStation;
  9 +import org.jeecg.modules.wms.lockStation.service.ILockStationService;
  10 +
  11 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  12 +import com.baomidou.mybatisplus.core.metadata.IPage;
  13 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  14 +import lombok.extern.slf4j.Slf4j;
  15 +
  16 +import org.jeecg.common.system.base.controller.JeecgController;
  17 +import org.springframework.beans.factory.annotation.Autowired;
  18 +import org.springframework.web.bind.annotation.*;
  19 +import org.springframework.web.servlet.ModelAndView;
  20 +import io.swagger.annotations.Api;
  21 +import io.swagger.annotations.ApiOperation;
  22 +import org.jeecg.common.aspect.annotation.AutoLog;
  23 +
  24 + /**
  25 + * @Description: 锁定站台
  26 + * @Author: jeecg-boot
  27 + * @Date: 2023-10-23
  28 + * @Version: V1.0
  29 + */
  30 +@Api(tags="锁定站台")
  31 +@RestController
  32 +@RequestMapping("/lock/lockStation")
  33 +@Slf4j
  34 +public class LockStationController extends JeecgController<LockStation, ILockStationService> {
  35 + @Autowired
  36 + private ILockStationService lockStationService;
  37 +
  38 + /**
  39 + * 分页列表查询
  40 + *
  41 + * @param lockStation
  42 + * @param pageNo
  43 + * @param pageSize
  44 + * @param req
  45 + * @return
  46 + */
  47 + //@AutoLog(value = "锁定站台-分页列表查询")
  48 + @ApiOperation(value="锁定站台-分页列表查询", notes="锁定站台-分页列表查询")
  49 + @GetMapping(value = "/list")
  50 + public Result<IPage<LockStation>> queryPageList(LockStation lockStation,
  51 + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
  52 + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
  53 + HttpServletRequest req) {
  54 + QueryWrapper<LockStation> queryWrapper = QueryGenerator.initQueryWrapper(lockStation, req.getParameterMap());
  55 + Page<LockStation> page = new Page<LockStation>(pageNo, pageSize);
  56 + IPage<LockStation> pageList = lockStationService.page(page, queryWrapper);
  57 + return Result.OK(pageList);
  58 + }
  59 +
  60 + /**
  61 + * 添加
  62 + *
  63 + * @param lockStation
  64 + * @return
  65 + */
  66 + @AutoLog(value = "锁定站台-添加")
  67 + @ApiOperation(value="锁定站台-添加", notes="锁定站台-添加")
  68 + @PostMapping(value = "/add")
  69 + public Result<String> add(@RequestBody LockStation lockStation) {
  70 + lockStationService.save(lockStation);
  71 + return Result.OK("添加成功!");
  72 + }
  73 +
  74 + /**
  75 + * 编辑
  76 + *
  77 + * @param lockStation
  78 + * @return
  79 + */
  80 + @AutoLog(value = "锁定站台-编辑")
  81 + @ApiOperation(value="锁定站台-编辑", notes="锁定站台-编辑")
  82 + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
  83 + public Result<String> edit(@RequestBody LockStation lockStation) {
  84 + lockStationService.updateById(lockStation);
  85 + return Result.OK("编辑成功!");
  86 + }
  87 +
  88 + /**
  89 + * 通过id删除
  90 + *
  91 + * @param id
  92 + * @return
  93 + */
  94 + @AutoLog(value = "锁定站台-通过id删除")
  95 + @ApiOperation(value="锁定站台-通过id删除", notes="锁定站台-通过id删除")
  96 + @DeleteMapping(value = "/delete")
  97 + public Result<String> delete(@RequestParam(name="id",required=true) String id) {
  98 + lockStationService.removeById(id);
  99 + return Result.OK("删除成功!");
  100 + }
  101 +
  102 + /**
  103 + * 批量删除
  104 + *
  105 + * @param ids
  106 + * @return
  107 + */
  108 + @AutoLog(value = "锁定站台-批量删除")
  109 + @ApiOperation(value="锁定站台-批量删除", notes="锁定站台-批量删除")
  110 + @DeleteMapping(value = "/deleteBatch")
  111 + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
  112 + this.lockStationService.removeByIds(Arrays.asList(ids.split(",")));
  113 + return Result.OK("批量删除成功!");
  114 + }
  115 +
  116 + /**
  117 + * 通过id查询
  118 + *
  119 + * @param id
  120 + * @return
  121 + */
  122 + //@AutoLog(value = "锁定站台-通过id查询")
  123 + @ApiOperation(value="锁定站台-通过id查询", notes="锁定站台-通过id查询")
  124 + @GetMapping(value = "/queryById")
  125 + public Result<LockStation> queryById(@RequestParam(name="id",required=true) String id) {
  126 + LockStation lockStation = lockStationService.getById(id);
  127 + if(lockStation==null) {
  128 + return Result.error("未找到对应数据");
  129 + }
  130 + return Result.OK(lockStation);
  131 + }
  132 +
  133 + /**
  134 + * 导出excel
  135 + *
  136 + * @param request
  137 + * @param lockStation
  138 + */
  139 + @RequestMapping(value = "/exportXls")
  140 + public ModelAndView exportXls(HttpServletRequest request, LockStation lockStation) {
  141 + return super.exportXls(request, lockStation, LockStation.class, "锁定站台");
  142 + }
  143 +
  144 + /**
  145 + * 通过excel导入数据
  146 + *
  147 + * @param request
  148 + * @param response
  149 + * @return
  150 + */
  151 + @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
  152 + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
  153 + return super.importExcel(request, response, LockStation.class);
  154 + }
  155 +
  156 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/entity/LockStation.java 0 → 100644
  1 +package org.jeecg.modules.wms.lockStation.entity;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.Date;
  5 +import com.baomidou.mybatisplus.annotation.IdType;
  6 +import com.baomidou.mybatisplus.annotation.TableId;
  7 +import com.baomidou.mybatisplus.annotation.TableName;
  8 +import lombok.Data;
  9 +import org.jeecg.common.aspect.annotation.Dict;
  10 +import org.jeecgframework.poi.excel.annotation.Excel;
  11 +import io.swagger.annotations.ApiModel;
  12 +import io.swagger.annotations.ApiModelProperty;
  13 +import lombok.EqualsAndHashCode;
  14 +import lombok.experimental.Accessors;
  15 +
  16 +/**
  17 + * @Description: 锁定站台
  18 + * @Author: jeecg-boot
  19 + * @Date: 2023-10-23
  20 + * @Version: V1.0
  21 + */
  22 +@Data
  23 +@TableName("lock_station")
  24 +@Accessors(chain = true)
  25 +@EqualsAndHashCode(callSuper = false)
  26 +@ApiModel(value="lock_station对象", description="锁定站台")
  27 +public class LockStation implements Serializable {
  28 + private static final long serialVersionUID = 1L;
  29 +
  30 + /**主键*/
  31 + @TableId(type = IdType.ASSIGN_ID)
  32 + @ApiModelProperty(value = "主键")
  33 + private String id;
  34 + /**仓库*/
  35 + @Excel(name = "仓库", width = 15)
  36 + @ApiModelProperty(value = "仓库")
  37 + private String warehouseCode;
  38 + /**站台*/
  39 + @Excel(name = "站台", width = 15)
  40 + @ApiModelProperty(value = "站台")
  41 + private String code;
  42 + /**任务ID*/
  43 + @Excel(name = "任务ID", width = 15)
  44 + @ApiModelProperty(value = "任务ID")
  45 + private String taskId;
  46 + /**状态*/
  47 + @Excel(name = "状态", width = 15, dicCode = "port_lock_status")
  48 + @Dict(dicCode = "port_lock_status")
  49 + @ApiModelProperty(value = "状态")
  50 + private Integer status;
  51 + /**库区*/
  52 + @Excel(name = "库区", width = 15)
  53 + @ApiModelProperty(value = "库区")
  54 + private String zoneCode;
  55 + /**创建人*/
  56 + @ApiModelProperty(value = "创建人")
  57 + private String createBy;
  58 + /**创建日期*/
  59 + @ApiModelProperty(value = "创建日期")
  60 + private Date createTime;
  61 + /**更新人*/
  62 + @ApiModelProperty(value = "更新人")
  63 + private String updateBy;
  64 + /**更新日期*/
  65 + @ApiModelProperty(value = "更新日期")
  66 + private Date updateTime;
  67 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/mapper/LockStationMapper.java 0 → 100644
  1 +package org.jeecg.modules.wms.lockStation.mapper;
  2 +
  3 +import org.jeecg.modules.wms.lockStation.entity.LockStation;
  4 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  5 +
  6 +/**
  7 + * @Description: 锁定站台
  8 + * @Author: jeecg-boot
  9 + * @Date: 2023-10-23
  10 + * @Version: V1.0
  11 + */
  12 +public interface LockStationMapper extends BaseMapper<LockStation> {
  13 +
  14 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/mapper/xml/LockStationMapper.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.lockStation.mapper.LockStationMapper">
  4 +
  5 +</mapper>
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/service/ILockStationService.java 0 → 100644
  1 +package org.jeecg.modules.wms.lockStation.service;
  2 +
  3 +import org.jeecg.modules.wms.lockStation.entity.LockStation;
  4 +import com.baomidou.mybatisplus.extension.service.IService;
  5 +
  6 +/**
  7 + * @Description: 锁定站台
  8 + * @Author: jeecg-boot
  9 + * @Date: 2023-10-23
  10 + * @Version: V1.0
  11 + */
  12 +public interface ILockStationService extends IService<LockStation> {
  13 +
  14 + /**
  15 + * 锁定站台,需判断当前站台是否是非锁定状态
  16 + * @author zengxiangping
  17 + * @createDate 2023年10月23日
  18 + * @param port
  19 + * @param warehouseCode
  20 + * @return
  21 + */
  22 + boolean lockStation(String port, String warehouseCode);
  23 +
  24 + /**
  25 + * 解锁站台
  26 + * @author zengxiangping
  27 + * @createDate 2023年10月23日
  28 + * @param port
  29 + * @param warehouseCode
  30 + * @return
  31 + */
  32 + boolean unlockStation(String port, String warehouseCode);
  33 +
  34 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/lockStation/service/impl/LockStationServiceImpl.java 0 → 100644
  1 +package org.jeecg.modules.wms.lockStation.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import org.jeecg.common.exception.JeecgBootException;
  6 +import org.jeecg.modules.wms.lockStation.entity.LockStation;
  7 +import org.jeecg.modules.wms.lockStation.mapper.LockStationMapper;
  8 +import org.jeecg.modules.wms.lockStation.service.ILockStationService;
  9 +import org.jeecg.utils.constant.QuantityConstant;
  10 +import org.springframework.stereotype.Service;
  11 +
  12 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  13 +import org.springframework.transaction.annotation.Transactional;
  14 +
  15 +/**
  16 + * @Description: 锁定站台
  17 + * @Author: jeecg-boot
  18 + * @Date: 2023-10-23
  19 + * @Version: V1.0
  20 + */
  21 +@Service
  22 +public class LockStationServiceImpl extends ServiceImpl<LockStationMapper, LockStation> implements ILockStationService {
  23 +
  24 + /**
  25 + * 锁定站台,需判断当前站台是否是非锁定状态
  26 + * @author zengxiangping
  27 + * @createDate 2023年10月23日
  28 + * @param port
  29 + * @param warehouseCode
  30 + * @return
  31 + */
  32 + @Override
  33 + @Transactional(rollbackFor = Exception.class)
  34 + public boolean lockStation(String port, String warehouseCode) {
  35 + if (port == null) {
  36 + throw new JeecgBootException("锁定站台,传入站台号为空");
  37 + }
  38 + LambdaUpdateWrapper<LockStation> lockStationLambdaUpdateWrapper = Wrappers.lambdaUpdate();
  39 + lockStationLambdaUpdateWrapper.eq(LockStation::getCode, port).eq(LockStation::getWarehouseCode, warehouseCode)
  40 + .eq(LockStation::getStatus, QuantityConstant.UNLOCK).set(LockStation::getStatus, QuantityConstant.LOCK);
  41 + return update(lockStationLambdaUpdateWrapper);
  42 + }
  43 +
  44 + /**
  45 + * 解锁站台
  46 + * @author zengxiangping
  47 + * @createDate 2023年10月23日
  48 + * @param port
  49 + * @param warehouseCode
  50 + * @return
  51 + */
  52 + @Override
  53 + public boolean unlockStation(String port, String warehouseCode) {
  54 + LambdaUpdateWrapper<LockStation> lockStationLambdaUpdateWrapper = Wrappers.lambdaUpdate();
  55 + lockStationLambdaUpdateWrapper.eq(LockStation::getCode, port).eq(LockStation::getWarehouseCode, warehouseCode).set(LockStation::getStatus,
  56 + QuantityConstant.UNLOCK);
  57 + return update(lockStationLambdaUpdateWrapper);
  58 + }
  59 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoCheckoutTask.java
... ... @@ -63,13 +63,12 @@ public class AutoCheckoutTask implements Job {
63 63 for (Container container : containerList) {
64 64 String zoneCode = container.getZoneCode();
65 65 String warehouseCode = container.getWarehouseCode();
66   - String toPort = null;
67   - if (StringUtils.isEmpty(zoneCode)) {
68   - toPort = autoCheckOutDtoList.get(0).getToPort();
69   - } else {
  66 + String toPort = autoCheckOutDtoList.get(0).getToPort();
  67 + if (!StringUtils.isEmpty(zoneCode)) {
70 68 for (AutoCheckOutDto autoCheckOutDto : autoCheckOutDtoList) {
71 69 if (zoneCode.equals(autoCheckOutDto.getZoneCode())) {
72 70 toPort = autoCheckOutDto.getToPort();
  71 + break;
73 72 }
74 73 }
75 74 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/entity/ReceiptContainerHeader.java
... ... @@ -65,6 +65,10 @@ public class ReceiptContainerHeader implements Serializable {
65 65 @Excel(name = "目标库位", width = 15)
66 66 @ApiModelProperty(value = "目标库位")
67 67 private String toLocationCode;
  68 + /** 起始入库口 */
  69 + @Excel(name = "起始入库口", width = 15)
  70 + @ApiModelProperty(value = "起始入库口")
  71 + private String fromPort;
68 72 /** 目标出入口 */
69 73 @Excel(name = "目标出入口", width = 15)
70 74 @ApiModelProperty(value = "目标出入口")
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
... ... @@ -16,6 +16,7 @@ import org.jeecg.modules.wms.config.container.service.IContainerService;
16 16 import org.jeecg.modules.wms.config.location.service.ILocationService;
17 17 import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
18 18 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService;
  19 +import org.jeecg.modules.wms.lockStation.service.ILockStationService;
19 20 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail;
20 21 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
21 22 import org.jeecg.modules.wms.receipt.receiptContainerHeader.mapper.ReceiptContainerDetailMapper;
... ... @@ -91,6 +92,9 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
91 92 @Resource
92 93 private IParameterConfigurationService parameterConfigurationService;
93 94  
  95 + @Resource
  96 + private ILockStationService lockStationService;
  97 +
94 98 @Override
95 99 @Transactional
96 100 public void delMain(String id) {
... ... @@ -132,6 +136,15 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
132 136 String fromLocationCode = receiptContainerHeader.getFromLocationCode();
133 137 String toLocationCode = receiptContainerHeader.getToLocationCode();
134 138 int taskType = receiptContainerHeader.getTaskType();
  139 + String fromPort = receiptContainerHeader.getFromPort();
  140 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  141 + if (container == null) {
  142 + return Result.error("托盘:" + containerCode + " 信息为空");
  143 + }
  144 + String zoneCode = container.getZoneCode();
  145 + if (StringUtils.isEmpty(zoneCode)) {
  146 + return Result.error("容器没有配置库区,请配置!");
  147 + }
135 148 boolean success = false;
136 149 List<ReceiptContainerDetail> receiptContainerDetailList =
137 150 receiptContainerDetailService.getReceiptContainerDetailListByHeaderId(receiptContainerHeader.getId());
... ... @@ -155,7 +168,9 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
155 168 throw new JeecgBootException(result.getMessage());
156 169 }
157 170 TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult();
158   - String zoneCode = taskLockEntity.getZoneCode();
  171 + if (taskLockEntity.getZoneCode() != null) {
  172 + zoneCode = taskLockEntity.getZoneCode();
  173 + }
159 174 taskHeader = new TaskHeader();
160 175 taskHeader.setContainerCode(containerCode);
161 176 taskHeader.setContainerFillStatus(containerFillStatus);
... ... @@ -244,6 +259,15 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
244 259 throw new JeecgBootException("创建入库任务, 更新入库单明细失败");
245 260 }
246 261 }
  262 + String value = parameterConfigurationService.getValueByCode(QuantityConstant.START_LOCKING_STATION,zoneCode);
  263 + if (StringUtils.isNotEmpty(value)) {
  264 + int lockStation = Integer.parseInt(value);
  265 + if (lockStation == QuantityConstant.START_LOCK_STATION) {
  266 + if (!lockStationService.lockStation(fromPort, warehouseCode)) {
  267 + throw new JeecgBootException("生成入库任务时,站台已经锁定:" + fromPort);
  268 + }
  269 + }
  270 + }
247 271 LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集
248 272 LogRecordContext.putVariable("receiptContainerDetailList", receiptContainerDetailList);// 操作日志收集
249 273 LogRecordContext.putVariable("extraJsonString1", JSON.toJSONString(receiptContainerDetailList));// 操作日志收集
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
... ... @@ -425,11 +425,12 @@ public class TaskHeaderController extends HuahengBaseController {
425 425 public Result createEmptyIn(@RequestBody TaskHeader taskHeader, HttpServletRequest req) {
426 426 String contaienrCode = taskHeader.getContainerCode();
427 427 String toLocationCode = taskHeader.getToLocationCode();
  428 + String toPortCode = taskHeader.getToPortCode();
428 429 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
429 430 Result result = handleMultiProcess("createEmptyIn", new MultiProcessListener() {
430 431 @Override
431 432 public Result<?> doProcess() {
432   - Result result = taskHeaderService.createEmptyIn(contaienrCode, toLocationCode, warehouseCode);
  433 + Result result = taskHeaderService.createEmptyIn(contaienrCode, toLocationCode, warehouseCode,toPortCode);
433 434 return result;
434 435 }
435 436 });
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
... ... @@ -131,7 +131,7 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
131 131 * @param warehouseCode
132 132 * @return
133 133 */
134   - Result<TaskHeader> createEmptyIn(String containerCode, String toLocationCode, String warehouseCode);
  134 + Result<TaskHeader> createEmptyIn(String containerCode, String toLocationCode, String warehouseCode, String toPortCode);
135 135  
136 136 /**
137 137 * 创建空托盘出库任务
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -32,6 +32,7 @@ import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailS
32 32 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService;
33 33 import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction;
34 34 import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService;
  35 +import org.jeecg.modules.wms.lockStation.service.ILockStationService;
35 36 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
36 37 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
37 38 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
... ... @@ -150,6 +151,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
150 151 private ITaskHeaderHistoryService taskHeaderHistoryService;
151 152 @Resource
152 153 private IShipmentCombinationService shipmentCombinationService;
  154 + @Resource
  155 + private ILockStationService lockStationService;
153 156  
154 157 @Override
155 158 @Transactional
... ... @@ -974,7 +977,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
974 977 */
975 978 @Override
976 979 @Transactional(rollbackFor = Exception.class)
977   - public Result<TaskHeader> createEmptyIn(String containerCode, String toLocationCode, String warehouseCode) {
  980 + public Result<TaskHeader> createEmptyIn(String containerCode, String toLocationCode, String warehouseCode, String toPortCode) {
978 981 log.info("开始创建空托入库任务" + containerCode);
979 982 if (StringUtils.isEmpty(containerCode)) {
980 983 return Result.error("创建空托盘入库时, 托盘号为空");
... ... @@ -982,6 +985,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
982 985 if (StringUtils.isEmpty(warehouseCode)) {
983 986 return Result.error("创建空托盘入库时, 仓库编码为空");
984 987 }
  988 +// if (StringUtils.isEmpty(toPortCode)) {
  989 +// return Result.error("创建空托盘入库时, 站台编码为空");
  990 +// }
  991 +// Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  992 +// if (container == null) {
  993 +// return Result.error("托盘:" + containerCode + " 信息为空");
  994 +// }
  995 +// String zoneCode = container.getZoneCode();
  996 +// if (StringUtils.isEmpty(zoneCode)) {
  997 +// return Result.error("容器没有配置库区,请配置!");
  998 +// }
985 999  
986 1000 Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_EMPTYRECEIPT, containerCode, QuantityConstant.EMPTY_STRING,
987 1001 toLocationCode, warehouseCode);
... ... @@ -995,7 +1009,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
995 1009 taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT);
996 1010 taskHeader.setToLocationCode(toLocationCode);
997 1011 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
  1012 +// taskHeader.setZoneCode(zoneCode);
998 1013 boolean success = taskHeaderService.save(taskHeader);
  1014 +// String value = parameterConfigurationService.getValueByCode(QuantityConstant.START_LOCKING_STATION, zoneCode);
  1015 +// if (StringUtils.isNotEmpty(value)) {
  1016 +// int lockStation = Integer.parseInt(value);
  1017 +// if (lockStation == QuantityConstant.START_LOCK_STATION) {
  1018 +// if (!lockStationService.lockStation(toPortCode, warehouseCode)) {
  1019 +// throw new JeecgBootException("生成入库任务时,站台已经锁定:" + toPortCode);
  1020 +// }
  1021 +// }
  1022 +// }
999 1023 log.info("完成创建空托入库任务");
1000 1024 if (!success) {
1001 1025 throw new JeecgBootException("创建空托盘入库时,保存任务失败");
... ...
huaheng-wms-core/src/main/java/org/jeecg/utils/OkHttpUtils.java
... ... @@ -84,7 +84,7 @@ public class OkHttpUtils {
84 84 * OkHTTP线程池空闲线程存活时间(秒)
85 85 */
86 86 public final static long KEEP_ALIVE_DURATION = 60;
87   -
  87 +
88 88 /**
89 89 * 最大读取时间(秒)
90 90 */
... ... @@ -100,7 +100,6 @@ public class OkHttpUtils {
100 100 */
101 101 public final static int MAX_RENTRY_COUNT_FAST = 0;
102 102  
103   -
104 103 private static final String CONTENT_TYPE = "Content-Type";
105 104  
106 105 /** 访问接口参数配置 */
... ... @@ -249,7 +248,7 @@ public class OkHttpUtils {
249 248 }
250 249 return result;
251 250 }
252   -
  251 +
253 252 /**
254 253 * JSONString形式发送POST请求
255 254 * @throws Exception
... ...
huaheng-wms-core/src/main/java/org/jeecg/utils/aspect/TaskBuildAudienceAspect.java
1 1 package org.jeecg.utils.aspect;
2 2  
  3 +import java.lang.reflect.Method;
  4 +import java.util.Date;
  5 +import java.util.List;
  6 +
  7 +import javax.annotation.Resource;
  8 +
3 9 import org.aspectj.lang.JoinPoint;
  10 +import org.aspectj.lang.ProceedingJoinPoint;
  11 +import org.aspectj.lang.annotation.Around;
4 12 import org.aspectj.lang.annotation.Aspect;
5 13 import org.aspectj.lang.annotation.Before;
6 14 import org.aspectj.lang.annotation.Pointcut;
  15 +import org.aspectj.lang.reflect.MethodSignature;
  16 +import org.jeecg.modules.system.service.ISysAnnouncementService;
  17 +import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
7 18 import org.jeecg.utils.HuahengJwtUtil;
  19 +import org.jeecg.utils.constant.QuantityConstant;
8 20 import org.jeecg.utils.support.ApiAuthentication;
  21 +import org.jeecg.utils.support.SystemSync;
9 22 import org.springframework.scheduling.annotation.EnableAsync;
10 23 import org.springframework.stereotype.Component;
11 24  
  25 +import com.aliyuncs.utils.StringUtils;
  26 +
  27 +import cn.hutool.core.date.DatePattern;
  28 +import cn.hutool.core.date.DateUnit;
  29 +import cn.hutool.core.date.DateUtil;
  30 +import cn.hutool.core.exceptions.ExceptionUtil;
  31 +import cn.hutool.core.text.StrSpliter;
  32 +import cn.hutool.extra.spring.SpringUtil;
12 33 import lombok.extern.slf4j.Slf4j;
13 34  
14 35 /**
... ... @@ -22,6 +43,15 @@ import lombok.extern.slf4j.Slf4j;
22 43 @EnableAsync
23 44 public class TaskBuildAudienceAspect {
24 45  
  46 + @Resource
  47 + IParameterConfigurationService parameterConfigurationService;
  48 +
  49 + @Resource
  50 + ISysAnnouncementService sysAnnouncementService;
  51 +
  52 + @Resource
  53 + SystemSync systemSync;
  54 +
25 55 @Pointcut("execution(* org.jeecg.modules.wms.monitor.job.*Task.execute(..))")
26 56 public void executeTask() {}
27 57  
... ... @@ -29,4 +59,48 @@ public class TaskBuildAudienceAspect {
29 59 public void doBefore(JoinPoint joinPoint) throws NoSuchMethodException, Throwable {
30 60 new ApiAuthentication.ApiAuthenticationBuild().audience(HuahengJwtUtil.TASK_AUDIENCE_NAME).bulid();
31 61 }
  62 +
  63 + @Around("executeTask()")
  64 + public Object doAround(ProceedingJoinPoint joinPoint) throws NoSuchMethodException {
  65 + String className = getClassAndMethodName(joinPoint);
  66 + long t1 = System.currentTimeMillis();
  67 + try {
  68 + // 执行下一个切面方法,若无则执行目标方法
  69 + Object object = joinPoint.proceed();
  70 + // 执行被拦截的方法
  71 + long t2 = System.currentTimeMillis();
  72 + String taskRunNoticeClassNames = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_RUN_NOTICE_CLASS_NAME);
  73 + String noticeName = className + " 定时任务执行完成";
  74 + String costTimeString = "耗时:" + (t2 - t1) + "ms";
  75 + if (!StringUtils.isEmpty(taskRunNoticeClassNames)) {
  76 + List<String> taskRunNoticeClassNameList = StrSpliter.split(taskRunNoticeClassNames, ",", true, true);
  77 + String userOrRoleString = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_JOB_EXCEPTION_NOTICE_ROLE_OR_NAME);
  78 + List<String> userOrRoleList = StrSpliter.split(userOrRoleString, ",", true, true);
  79 + for (String taskRunNoticeClassName : taskRunNoticeClassNameList) {
  80 + if (className.contains(taskRunNoticeClassName)) {
  81 + sysAnnouncementService.quickAnnouncementToUserOrRole(userOrRoleList, noticeName, costTimeString, DateUtil.offsetMinute(new Date(), 1), "L");
  82 + break;
  83 + }
  84 + }
  85 + }
  86 + log.info(noticeName + " " + costTimeString);
  87 + return object;
  88 + } catch (Throwable e) {
  89 + long t2 = System.currentTimeMillis();
  90 + String userOrRoleString = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_JOB_EXCEPTION_NOTICE_ROLE_OR_NAME);
  91 + List<String> userOrRoleList = StrSpliter.split(userOrRoleString, ",", true, true);
  92 + String noticeName = className + " 定时任务执行异常";
  93 + String errorString = "异常信息:" + ExceptionUtil.getMessage(e) + " 耗时:" + (t2 - t1) + "ms";
  94 + systemSync.sumCountAnnouncementToUserOrRole(userOrRoleList, noticeName, errorString, DateUtil.offsetDay(new Date(), 1), "H", 10);
  95 + log.error(noticeName, e);
  96 + }
  97 + return null;
  98 + }
  99 +
  100 + // 获取方法类名
  101 + private String getClassAndMethodName(ProceedingJoinPoint joinPoint) throws NoSuchMethodException {
  102 + // 获取目标类对象
  103 + Class<?> aClass = joinPoint.getTarget().getClass();
  104 + return aClass.getSimpleName();
  105 + }
32 106 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... ... @@ -307,9 +307,6 @@ public class QuantityConstant {
307 307 /** 移库 */
308 308 public static final Integer INVENTORY_TRANSACTION_TRANSFER = 50;
309 309  
310   - /** 收货 */
311   - public static final Integer INVENTORY_TRANSACTION_RECEIVE = 60;
312   -
313 310 // 12、调整单状态
314 311  
315 312 // 未批准
... ... @@ -340,12 +337,20 @@ public class QuantityConstant {
340 337  
341 338 // 13、质检单类型
342 339  
343   - /** 来料质检 */
344   - public static final String QUALITY_TYPE_INCOMING = "QI";
345   - /** 库内全检 */
346   - public static final String QUALITY_TYPE_INHOUSE_FULL = "QIF";
347   - /** 库内抽检 */
348   - public static final String QUALITY_TYPE_INHOUSE_PART = "QIP";
  340 + // 入库质检
  341 + public static final Integer CHECK_TYPE_RECEIPT = 100;
  342 +
  343 + // 在库全检
  344 + public static final Integer CHECK_TYPE_FULL = 200;
  345 +
  346 + // 在库抽检
  347 + public static final Integer CHECK_TYPE_SELECT = 300;
  348 +
  349 + // 空货架
  350 + public static final Integer POINTS_EMPTY = 0;
  351 +
  352 + // 非空货架
  353 + public static final Integer POINTS_SOME = 1;
349 354  
350 355 // 14、AGV任务
351 356 /** AGV取放货任务 */
... ... @@ -397,15 +402,7 @@ public class QuantityConstant {
397 402 public static final Integer RECEIVE_HEADER_HALF = 100;
398 403 // 收货单完成收货状态
399 404 public static final Integer RECEIVE_HEADER_COMPLETE = 200;
400   - // 生成质检单
401   - public static final Integer RECEIVE_HEADER_QUALITY = 300;
402   -
403   - // 新建
404   - public static final Integer QUALITY_HEADER_BUILD = 0;
405   - // 部分质检
406   - public static final Integer QUALITY_HEADER_HALF = 100;
407   - // 质检完成
408   - public static final Integer QUALITY_HEADER_COMPLETE = 200;
  405 +
409 406  
410 407 /** 对接WCS可用巷道API */
411 408 public static final String ADDRESS_WCS_AVAILABLE_ROWDWAY = "WCS_AVAILABLE_ROWDWAY";
... ... @@ -454,14 +451,8 @@ public class QuantityConstant {
454 451 public static final String PLATFORM_CODING = "赋码系统";
455 452 public static final String PLATFORM_ERP = "ERP";
456 453 public static final String PLATFORM_WMS = "WMS";
457   - // 良品
  454 + // good
458 455 public static final String QUALITY_GOOD = "good";
459   - // 次品
460   - public static final String QUALITY_DEFECTIVE = "defective";
461   - // 报废品
462   - public static final String QUALITY_SCRAP = "scrap";
463   - // 待确认
464   - public static final String QUALITY_DISUSSED = "discussed";
465 456  
466 457 // 发送AGV任务成功
467 458 public static final int AGV_NEED_SEND = 0;
... ... @@ -524,18 +515,26 @@ public class QuantityConstant {
524 515 * 出库依赖库区
525 516 */
526 517 public static final int SHIPMENT_BY_ZONE = 1;
527   -
528   - /** 对接WCS可用巷道API:关闭 */
  518 +
  519 + /** 对接WCS可用巷道API:关闭 */
529 520 public static final String AVAILABLE_ROWDWAY_CLOSE = "0";
530   -
  521 +
531 522 /** 对接WCS可用巷道API:开启 */
532 523 public static final String AVAILABLE_ROWDWAY_OPEN = "1";
533   -
  524 +
534 525 /** 启用获取可用巷道API */
535 526 public static final String RULE_AVAILABLE_ROWDWAY_STATUS = "availableRowdwayStatus";
536   -
537   - /** 接口异常响应通知配置 */
  527 +
  528 + /** 接口异常响应通知配置 */
  529 +
  530 + /** 定时任务异常响应通知配置 */
  531 + public static final String RULE_JOB_EXCEPTION_NOTICE_ROLE_OR_NAME = "jobExceptionNoticeRoleOrName";
  532 +
  533 + /** 接口异常响应通知配置 */
538 534 public static final String RULE_API_EXCEPTION_NOTICE_ROLE_OR_NAME = "apiExceptionNoticeRoleOrName";
  535 +
  536 + /** 定时任务执行消息通知配置 */
  537 + public static final String RULE_TASK_RUN_NOTICE_CLASS_NAME = "taskRunNoticeClassName";
539 538  
540 539 public static final int RULE_TASK_NOT_CLEAR = 0;
541 540 public static final int RULE_TASK_AllOW_CLEAR = 1;
... ... @@ -703,4 +702,17 @@ public class QuantityConstant {
703 702 public static final String ZONE_TYPE_TILL = "Q";
704 703 /** 库区类型,虚拟区 */
705 704 public static final String ZONE_TYPE_UNREAL = "X";
  705 +
  706 + public static final String START_LOCKING_STATION = "StartLockingStation";
  707 +
  708 + public static int LOCK = 1; // 锁定
  709 +
  710 + public static int UNLOCK = 0; // 解锁
  711 +
  712 +// 开启站台锁定
  713 + public static int START_LOCK_STATION = 1;
  714 +
  715 +// 关闭站台锁定
  716 + public static int START_UNLOCK_STATION = 0;
  717 +
706 718 }
... ...