Commit 787e3ec755605dadf4c9b31e7690c84a631a7252
Merge remote-tracking branch 'origin/develop' into develop
Showing
21 changed files
with
388 additions
and
178 deletions
ant-design-vue-jeecg/.env.production
1 | 1 | NODE_ENV=production |
2 | 2 | VUE_APP_ENV=production |
3 | 3 | outputDir=dist |
4 | -VUE_APP_API_BASE_URL=http://127.0.0.1:8080/wms | |
4 | +VUE_APP_API_BASE_URL=http://101.132.100.116:8080/wms | |
5 | 5 | VUE_APP_CAS_BASE_URL=http://localhost:8443/cas |
6 | 6 | VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview |
7 | 7 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/components/layouts/UserLayout.vue
... | ... | @@ -107,7 +107,7 @@ export default { |
107 | 107 | .desc { |
108 | 108 | font-size: 24px; |
109 | 109 | color: #111; |
110 | - margin-top: 170px; | |
110 | + margin-top: 10%; | |
111 | 111 | margin-bottom: 70px; |
112 | 112 | font-weight: bolder; |
113 | 113 | } |
... | ... | @@ -117,6 +117,9 @@ export default { |
117 | 117 | min-width: 260px; |
118 | 118 | width: 368px; |
119 | 119 | margin: 0 auto; |
120 | + height: auto; | |
121 | + position: relative; | |
122 | + min-height: 400px; | |
120 | 123 | } |
121 | 124 | |
122 | 125 | .footer { |
... | ... |
ant-design-vue-jeecg/src/views/system/config/LocationList.vue
... | ... | @@ -57,6 +57,11 @@ |
57 | 57 | <j-dict-select-tag placeholder="请选择是否可用" v-model="queryParam.enable" dictCode="enable_status"/> |
58 | 58 | </a-form-item> |
59 | 59 | </a-col> |
60 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
61 | + <a-form-item label="库内是否有托盘"> | |
62 | + <j-dict-select-tag placeholder="请选择库内是否有托盘" v-model="queryParam.haveContainer" dictCode="have_container_in_location"/> | |
63 | + </a-form-item> | |
64 | + </a-col> | |
60 | 65 | <template v-if="toggleSearchStatus"> |
61 | 66 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
62 | 67 | <a-form-item label="行"> |
... | ... | @@ -161,6 +166,12 @@ |
161 | 166 | </a-tag> |
162 | 167 | </span> |
163 | 168 | |
169 | + <span slot="haveContainer_dictText" slot-scope="haveContainer_dictText"> | |
170 | + <a-tag :key="haveContainer_dictText" :color="getStatusColor(haveContainer_dictText)"> | |
171 | + {{ haveContainer_dictText }} | |
172 | + </a-tag> | |
173 | + </span> | |
174 | + | |
164 | 175 | <span slot="high_dictText" slot-scope="high_dictText"> |
165 | 176 | <a-tag :key="high_dictText" :color="getStatusColor(high_dictText)"> |
166 | 177 | {{ high_dictText }} |
... | ... | @@ -329,6 +340,12 @@ export default { |
329 | 340 | dataIndex: 'materialAreaCode' |
330 | 341 | }, |
331 | 342 | { |
343 | + title: '是否有托盘', | |
344 | + align: 'center', | |
345 | + dataIndex: 'haveContainer_dictText', | |
346 | + scopedSlots: {customRender: 'haveContainer_dictText'} | |
347 | + }, | |
348 | + { | |
332 | 349 | title: '是否可用', |
333 | 350 | align: 'center', |
334 | 351 | dataIndex: 'enable_dictText' |
... | ... | @@ -404,6 +421,7 @@ export default { |
404 | 421 | '内侧': 'purple', |
405 | 422 | |
406 | 423 | '高库位': 'red', |
424 | + '没有': 'red', | |
407 | 425 | '低库位': 'green', |
408 | 426 | default: 'blue' |
409 | 427 | }; |
... | ... |
ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue
... | ... | @@ -37,6 +37,13 @@ |
37 | 37 | </a-tag> |
38 | 38 | </span> |
39 | 39 | |
40 | + <span slot="controller_dictText" slot-scope="controller_dictText"> | |
41 | + <a-tag :key="controller_dictText" :color="getStatusColor(controller_dictText)"> | |
42 | + {{ controller_dictText }} | |
43 | + </a-tag> | |
44 | + </span> | |
45 | + | |
46 | + | |
40 | 47 | <span slot="companyCode" slot-scope="companyCode"> |
41 | 48 | <a-tag :key="companyCode" color="blue"> |
42 | 49 | {{ solutionCompany(companyCode) }} |
... | ... | @@ -192,6 +199,12 @@ export default { |
192 | 199 | scopedSlots: {customRender: 'inventoryStatus_dictText'} |
193 | 200 | }, |
194 | 201 | { |
202 | + title: '受控状态', | |
203 | + align: 'center', | |
204 | + dataIndex: 'controller_dictText', | |
205 | + scopedSlots: {customRender: 'controller_dictText'} | |
206 | + }, | |
207 | + { | |
195 | 208 | title: '批次', |
196 | 209 | align: 'center', |
197 | 210 | dataIndex: 'batch' |
... | ... |
ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue
... | ... | @@ -49,6 +49,15 @@ |
49 | 49 | </a-form-item> |
50 | 50 | </a-col> |
51 | 51 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
52 | + <a-form-item label="受控状态"> | |
53 | + <j-dict-select-tag | |
54 | + placeholder="请选择受控状态" | |
55 | + v-model="queryParam.controller" | |
56 | + dictCode="inventory_controller" | |
57 | + /> | |
58 | + </a-form-item> | |
59 | + </a-col> | |
60 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
52 | 61 | <a-form-item label="物料编码"> |
53 | 62 | <a-input placeholder="请输入物料编码" v-model="queryParam.materialCode"></a-input> |
54 | 63 | </a-form-item> |
... | ... | @@ -127,6 +136,8 @@ |
127 | 136 | > |
128 | 137 | <a-button type="primary" icon="import">导入</a-button> |
129 | 138 | </a-upload> |
139 | + <a-button v-has="'inventoryDetail:controller'" @click='controller()' type='primary'>受控</a-button> | |
140 | + <a-button v-has="'inventoryDetail:releaseController'" @click='releaseController()' type='primary'>释放受控</a-button> | |
130 | 141 | <!-- 高级查询区域 --> |
131 | 142 | <j-super-query |
132 | 143 | :fieldList="superFieldList" |
... | ... | @@ -144,10 +155,10 @@ |
144 | 155 | |
145 | 156 | <!-- table区域-begin --> |
146 | 157 | <div> |
147 | - <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> | |
148 | - <!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项--> | |
149 | - <!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>--> | |
150 | - <!-- </div>--> | |
158 | + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
159 | + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项 | |
160 | + <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |
161 | + </div> | |
151 | 162 | |
152 | 163 | <a-table |
153 | 164 | ref="table" |
... | ... | @@ -159,9 +170,16 @@ |
159 | 170 | :dataSource="dataSource" |
160 | 171 | :pagination="ipagination" |
161 | 172 | :loading="loading" |
173 | + :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" | |
162 | 174 | class="j-table-force-nowrap" |
163 | 175 | @change="handleTableChange" |
164 | 176 | > |
177 | + <span slot="controller_dictText" slot-scope="controller_dictText"> | |
178 | + <a-tag :key="controller_dictText" :color="getStatusColor(controller_dictText)"> | |
179 | + {{ controller_dictText }} | |
180 | + </a-tag> | |
181 | + </span> | |
182 | + | |
165 | 183 | <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> |
166 | 184 | <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> |
167 | 185 | {{ inventoryStatus_dictText }} |
... | ... | @@ -216,7 +234,8 @@ import {mixinDevice} from '@/utils/mixin' |
216 | 234 | import {JeecgListMixin} from '@/mixins/JeecgListMixin' |
217 | 235 | import SimpleInventoryDetailModal from './modules/SimpleInventoryDetailModal' |
218 | 236 | import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
219 | -import {getCompanyList, getZoneList} from "@api/api"; | |
237 | +import {getCompanyList, getZoneList, } from "@api/api"; | |
238 | +import {postAction} from '@/api/manage' | |
220 | 239 | |
221 | 240 | export default { |
222 | 241 | name: 'InventoryDetailList', |
... | ... | @@ -308,6 +327,12 @@ export default { |
308 | 327 | scopedSlots: {customRender: 'inventoryStatus_dictText'} |
309 | 328 | }, |
310 | 329 | { |
330 | + title: '受控状态', | |
331 | + align: 'center', | |
332 | + dataIndex: 'controller_dictText', | |
333 | + scopedSlots: {customRender: 'controller_dictText'} | |
334 | + }, | |
335 | + { | |
311 | 336 | title: '批次', |
312 | 337 | align: 'center', |
313 | 338 | dataIndex: 'batch' |
... | ... | @@ -361,7 +386,10 @@ export default { |
361 | 386 | delete: '/inventory/inventoryDetail/delete', |
362 | 387 | deleteBatch: '/inventory/inventoryDetail/deleteBatch', |
363 | 388 | exportXlsUrl: '/inventory/inventoryDetail/exportXls', |
364 | - importExcelUrl: 'inventory/inventoryDetail/importExcel' | |
389 | + importExcelUrl: 'inventory/inventoryDetail/importExcel', | |
390 | + controller: 'inventory/inventoryHeader/controller', | |
391 | + quickShipment: 'inventory/inventoryHeader/quickShipment', | |
392 | + releaseController: 'inventory/inventoryHeader/releaseController', | |
365 | 393 | }, |
366 | 394 | dictOptions: {}, |
367 | 395 | superFieldList: [] |
... | ... | @@ -407,7 +435,80 @@ export default { |
407 | 435 | } |
408 | 436 | }) |
409 | 437 | }, |
410 | - | |
438 | + controller: function() { | |
439 | + if (this.selectedRowKeys.length <= 0) { | |
440 | + this.$message.warning('请选择一条记录!') | |
441 | + } else { | |
442 | + let that = this; | |
443 | + this.$confirm({ | |
444 | + title: '确认受控', | |
445 | + content: '是否受控选中数据?', | |
446 | + onOk: function() { | |
447 | + that.loading = true; | |
448 | + postAction(that.url.controller, that.selectedRowKeys).then((res) => { | |
449 | + if (res.success) { | |
450 | + //重新计算分页问题 | |
451 | + that.reCalculatePage(that.selectedRowKeys.length); | |
452 | + that.$message.success(res.message); | |
453 | + that.loadData(); | |
454 | + that.onClearSelected(); | |
455 | + } else { | |
456 | + that.$message.warning(res.message); | |
457 | + this.selectedRowKeys = []; | |
458 | + } | |
459 | + }).finally(() => { | |
460 | + that.loading = false; | |
461 | + }) | |
462 | + } | |
463 | + }) | |
464 | + } | |
465 | + }, | |
466 | + releaseController() { | |
467 | + if (this.selectedRowKeys.length <= 0) { | |
468 | + this.$message.warning('请选择一条记录!') | |
469 | + } else { | |
470 | + let that = this; | |
471 | + this.$confirm({ | |
472 | + title: '释放受控', | |
473 | + content: '释放受控选中数据?', | |
474 | + onOk: function() { | |
475 | + that.loading = true; | |
476 | + postAction(that.url.releaseController, that.selectedRowKeys).then((res) => { | |
477 | + if (res.success) { | |
478 | + //重新计算分页问题 | |
479 | + that.reCalculatePage(that.selectedRowKeys.length); | |
480 | + that.$message.success(res.message); | |
481 | + that.loadData(); | |
482 | + that.onClearSelected(); | |
483 | + } else { | |
484 | + that.$message.warning(res.message); | |
485 | + this.selectedRowKeys = []; | |
486 | + } | |
487 | + }).finally(() => { | |
488 | + that.loading = false; | |
489 | + }) | |
490 | + } | |
491 | + }) | |
492 | + } | |
493 | + }, | |
494 | + quickShipment() { | |
495 | + if (this.selectedRowKeys.length <= 0) { | |
496 | + this.$message.warning('请选择一条记录!'); | |
497 | + } else { | |
498 | + let zoneCodes = this.selectRecord.map(row => row.zoneCode) | |
499 | + if (new Set(zoneCodes).size !== 1) { | |
500 | + this.$message.warning('所选数据非同库区'); | |
501 | + return; | |
502 | + } | |
503 | + if ('D' !== this.selectRecord[0].zoneCode){ | |
504 | + this.$refs.quickShipmentModel.model.containerCode = this.selectRecord[0].containerCode; | |
505 | + this.$refs.quickShipmentModel.edit(); | |
506 | + this.$refs.quickShipmentModel.title = '选择出库口'; | |
507 | + }else { | |
508 | + this.quickShipmentModalFormOk(null) | |
509 | + } | |
510 | + } | |
511 | + }, | |
411 | 512 | solutionCompany(value) { |
412 | 513 | var actions = [] |
413 | 514 | Object.keys(this.companyList).some(key => { |
... | ... | @@ -443,6 +544,7 @@ export default { |
443 | 544 | fieldList.push({type: 'BigDecimal', value: 'qty', text: '数量', dictCode: ''}) |
444 | 545 | fieldList.push({type: 'BigDecimal', value: 'taskQty', text: '任务锁定数量', dictCode: ''}) |
445 | 546 | fieldList.push({type: 'string', value: 'inventoryStatus', text: '库存状态', dictCode: 'inventory_status'}) |
547 | + fieldList.push({type: 'int', value: 'controller', text: '受控状态', dictCode: 'inventory_controller'}) | |
446 | 548 | fieldList.push({type: 'string', value: 'batch', text: '批次', dictCode: ''}) |
447 | 549 | // fieldList.push({type:'string',value:'sn',text:'序列号',dictCode:''}) |
448 | 550 | fieldList.push({type: 'datetime', value: 'receiptDate', text: '入库日期'}) |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... | ... | @@ -243,6 +243,9 @@ public class WcsServiceImpl implements WcsService { |
243 | 243 | // 如果是外侧库位,那么就要判断该库位对应的内侧库位是不是有托盘 |
244 | 244 | if (rowFlag == QuantityConstant.ROW_OUT) { |
245 | 245 | Location insideLocation = locationService.getInsideNear(location); |
246 | + if (insideLocation == null) { | |
247 | + return Result.error("分配库位时" + locationCode + "没有找到对应的内侧库位"); | |
248 | + } | |
246 | 249 | if (StringUtils.isNotEmpty(insideLocation.getContainerCode())) { |
247 | 250 | Location destinationLocation = locationService.getEmptyLocation(insideLocation); |
248 | 251 | if (destinationLocation == null) { |
... | ... | @@ -348,6 +351,9 @@ public class WcsServiceImpl implements WcsService { |
348 | 351 | if (rowFlag == QuantityConstant.ROW_OUT) { |
349 | 352 | // 找到对应内侧库位 |
350 | 353 | Location insideLocation = locationService.getInsideNear(fromLocation); |
354 | + if (insideLocation == null) { | |
355 | + return Result.error("分配库位时" + fromLocation + "没有找到对应的内侧库位"); | |
356 | + } | |
351 | 357 | String insideLocationCode = insideLocation.getCode(); |
352 | 358 | // 如果对应内侧库位有托盘 |
353 | 359 | if (StringUtils.isNotEmpty(insideLocation.getContainerCode())) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java
... | ... | @@ -13,12 +13,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; |
13 | 13 | import org.jeecg.common.system.base.controller.JeecgController; |
14 | 14 | import org.jeecg.common.system.query.QueryGenerator; |
15 | 15 | import org.jeecg.modules.wms.config.container.service.IContainerService; |
16 | -import org.jeecg.modules.wms.config.location.dto.CompareContainerTaskDto; | |
17 | -import org.jeecg.modules.wms.config.location.dto.CompareLocationDto; | |
18 | -import org.jeecg.modules.wms.config.location.dto.CompareLocationTaskDto; | |
19 | -import org.jeecg.modules.wms.config.location.dto.QueryCompareContainerTaskDto; | |
20 | -import org.jeecg.modules.wms.config.location.dto.QueryCompareLocationDto; | |
21 | -import org.jeecg.modules.wms.config.location.dto.QueryCompareLocationTaskDto; | |
16 | +import org.jeecg.modules.wms.config.location.dto.*; | |
22 | 17 | import org.jeecg.modules.wms.config.location.entity.BatchLocation; |
23 | 18 | import org.jeecg.modules.wms.config.location.entity.Location; |
24 | 19 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
... | ... | @@ -28,15 +23,7 @@ import org.jeecg.utils.StringUtils; |
28 | 23 | import org.jeecg.utils.constant.QuantityConstant; |
29 | 24 | import org.springframework.beans.factory.annotation.Autowired; |
30 | 25 | import org.springframework.validation.annotation.Validated; |
31 | -import org.springframework.web.bind.annotation.DeleteMapping; | |
32 | -import org.springframework.web.bind.annotation.GetMapping; | |
33 | -import org.springframework.web.bind.annotation.PostMapping; | |
34 | -import org.springframework.web.bind.annotation.RequestBody; | |
35 | -import org.springframework.web.bind.annotation.RequestMapping; | |
36 | -import org.springframework.web.bind.annotation.RequestMethod; | |
37 | -import org.springframework.web.bind.annotation.RequestParam; | |
38 | -import org.springframework.web.bind.annotation.ResponseBody; | |
39 | -import org.springframework.web.bind.annotation.RestController; | |
26 | +import org.springframework.web.bind.annotation.*; | |
40 | 27 | import org.springframework.web.servlet.ModelAndView; |
41 | 28 | |
42 | 29 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
... | ... | @@ -79,8 +66,17 @@ public class LocationController extends JeecgController<Location, ILocationServi |
79 | 66 | public Result<IPage<Location>> queryPageList(Location location, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
80 | 67 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
81 | 68 | HuahengJwtUtil.setWarehouseCode(req, location); |
69 | + Integer haveContainer = location.getHaveContainerInLocation(); | |
70 | + location.setHaveContainer(null); | |
82 | 71 | QueryWrapper<Location> queryWrapper = QueryGenerator.initQueryWrapper(location, null); |
83 | 72 | LambdaQueryWrapper<Location> locationLambdaQueryWrapper = queryWrapper.lambda(); |
73 | + if (haveContainer != null) { | |
74 | + if (haveContainer == QuantityConstant.STATUS_NOT_CONTAINER) { | |
75 | + locationLambdaQueryWrapper.eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING); | |
76 | + } else if (haveContainer == QuantityConstant.STATUS_HAVE_CONTAINER) { | |
77 | + locationLambdaQueryWrapper.ne(Location::getContainerCode, QuantityConstant.EMPTY_STRING); | |
78 | + } | |
79 | + } | |
84 | 80 | locationLambdaQueryWrapper.orderByAsc(Location::getId); |
85 | 81 | Page<Location> page = new Page<Location>(pageNo, pageSize); |
86 | 82 | IPage<Location> pageList = locationService.page(page, locationLambdaQueryWrapper); |
... | ... | @@ -252,7 +248,8 @@ public class LocationController extends JeecgController<Location, ILocationServi |
252 | 248 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); |
253 | 249 | String containerCode = location.getContainerCode(); |
254 | 250 | String locationCode = location.getCode(); |
255 | - List<Location> locationList = locationService.getContainerInLocation(containerCode, QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, locationCode, warehouseCode); | |
251 | + List<Location> locationList = | |
252 | + locationService.getContainerInLocation(containerCode, QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, locationCode, warehouseCode); | |
256 | 253 | return Result.OK(locationList); |
257 | 254 | } |
258 | 255 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/entity/Location.java
1 | 1 | package org.jeecg.modules.wms.config.location.entity; |
2 | 2 | |
3 | 3 | import java.io.Serializable; |
4 | -import java.io.UnsupportedEncodingException; | |
5 | -import java.util.Date; | |
6 | 4 | import java.math.BigDecimal; |
5 | +import java.util.Date; | |
7 | 6 | import java.util.List; |
8 | 7 | |
8 | +import org.jeecg.common.aspect.annotation.Dict; | |
9 | +import org.jeecg.utils.StringUtils; | |
10 | +import org.jeecg.utils.constant.QuantityConstant; | |
11 | +import org.jeecgframework.poi.excel.annotation.Excel; | |
12 | + | |
9 | 13 | import com.baomidou.mybatisplus.annotation.IdType; |
10 | 14 | import com.baomidou.mybatisplus.annotation.TableField; |
11 | 15 | import com.baomidou.mybatisplus.annotation.TableId; |
12 | 16 | import com.baomidou.mybatisplus.annotation.TableName; |
13 | -import lombok.Data; | |
14 | -import com.fasterxml.jackson.annotation.JsonFormat; | |
15 | -import org.springframework.format.annotation.DateTimeFormat; | |
16 | -import org.jeecgframework.poi.excel.annotation.Excel; | |
17 | -import org.jeecg.common.aspect.annotation.Dict; | |
17 | + | |
18 | 18 | import io.swagger.annotations.ApiModel; |
19 | 19 | import io.swagger.annotations.ApiModelProperty; |
20 | +import lombok.Data; | |
20 | 21 | import lombok.EqualsAndHashCode; |
21 | 22 | import lombok.experimental.Accessors; |
22 | 23 | |
... | ... | @@ -141,4 +142,25 @@ public class Location implements Serializable { |
141 | 142 | /** 库存所在库位状态 */ |
142 | 143 | @TableField(exist = false) |
143 | 144 | private String locationAttribute; |
145 | + /** 库位是否有托盘 */ | |
146 | + @TableField(exist = false) | |
147 | + @Dict(dicCode = "have_container_in_location") | |
148 | + private Integer haveContainer; | |
149 | + | |
150 | + public void setHaveContainer(Integer haveContainer) { | |
151 | + this.haveContainer = haveContainer; | |
152 | + } | |
153 | + | |
154 | + public Integer getHaveContainer() { | |
155 | + if (StringUtils.isNotEmpty(containerCode)) { | |
156 | + return QuantityConstant.STATUS_HAVE_CONTAINER; | |
157 | + } else { | |
158 | + return QuantityConstant.STATUS_NOT_CONTAINER; | |
159 | + } | |
160 | + } | |
161 | + | |
162 | + public Integer getHaveContainerInLocation() { | |
163 | + return this.haveContainer; | |
164 | + } | |
165 | + | |
144 | 166 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/controller/InventoryHeaderController.java
... | ... | @@ -14,6 +14,7 @@ import org.apache.shiro.SecurityUtils; |
14 | 14 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
15 | 15 | import org.jeecg.common.api.vo.Result; |
16 | 16 | import org.jeecg.common.aspect.annotation.AutoLog; |
17 | +import org.jeecg.common.exception.JeecgBootException; | |
17 | 18 | import org.jeecg.common.system.base.controller.JeecgController; |
18 | 19 | import org.jeecg.common.system.query.QueryGenerator; |
19 | 20 | import org.jeecg.common.system.vo.LoginUser; |
... | ... | @@ -27,6 +28,7 @@ import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderS |
27 | 28 | import org.jeecg.utils.HuahengJwtUtil; |
28 | 29 | import org.jeecg.utils.StringUtils; |
29 | 30 | import org.jeecg.utils.constant.QuantityConstant; |
31 | +import org.jeecg.utils.support.ApiLogger; | |
30 | 32 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
31 | 33 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
32 | 34 | import org.jeecgframework.poi.excel.entity.ExportParams; |
... | ... | @@ -342,4 +344,27 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, |
342 | 344 | |
343 | 345 | /*--------------------------------子表处理-库存详情-end----------------------------------------------*/ |
344 | 346 | |
347 | + @AutoLog("库存详情-释放受控") | |
348 | + @ApiOperation(value = "释放受控", notes = "释放受控") | |
349 | + @ApiLogger(apiName = "释放受控") | |
350 | + @PostMapping(value = "/releaseController") | |
351 | + @ResponseBody | |
352 | + public Result releaseController(@RequestBody List<Integer> ids, HttpServletRequest req) { | |
353 | + if (StringUtils.isEmpty(ids)) { | |
354 | + throw new JeecgBootException("库存明细id为空"); | |
355 | + } | |
356 | + return inventoryDetailService.releaseController(ids); | |
357 | + } | |
358 | + | |
359 | + @AutoLog("库存详情-批量受控") | |
360 | + @ApiOperation(value = "批量受控", notes = "批量受控") | |
361 | + @ApiLogger(apiName = "批量受控") | |
362 | + @PostMapping("/controller") | |
363 | + @ResponseBody | |
364 | + public Result controller(@RequestBody List<Integer> ids) { | |
365 | + if (StringUtils.isEmpty(ids)) { | |
366 | + return Result.error("库存明细id为空"); | |
367 | + } | |
368 | + return inventoryDetailService.controller(ids); | |
369 | + } | |
345 | 370 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryDetail.java
... | ... | @@ -125,6 +125,11 @@ public class InventoryDetail implements Serializable { |
125 | 125 | @Excel(name = "库龄(天)", width = 15) |
126 | 126 | @ApiModelProperty(value = "库龄(天)") |
127 | 127 | private Integer inventoryAge; |
128 | + /** 受控 */ | |
129 | + @Excel(name = "受控", width = 15) | |
130 | + @Dict(dicCode = "inventory_controller") | |
131 | + @ApiModelProperty(value = "受控") | |
132 | + private Integer controller; | |
128 | 133 | /** 备用字段1 */ |
129 | 134 | @Excel(name = "备用字段1", width = 15) |
130 | 135 | @ApiModelProperty(value = "备用字段1") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java
... | ... | @@ -3,6 +3,7 @@ package org.jeecg.modules.wms.inventory.inventoryHeader.service; |
3 | 3 | import java.math.BigDecimal; |
4 | 4 | import java.util.List; |
5 | 5 | |
6 | +import org.jeecg.common.api.vo.Result; | |
6 | 7 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
7 | 8 | |
8 | 9 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
... | ... | @@ -59,4 +60,18 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { |
59 | 60 | * @param inventoryDetailList |
60 | 61 | */ |
61 | 62 | void calculateInventoryAge(List<InventoryDetail> inventoryDetailList); |
63 | + | |
64 | + /** | |
65 | + * 批量设置受控 | |
66 | + * @param inventoryDetailIdList 库存明细id | |
67 | + * @return | |
68 | + */ | |
69 | + Result controller(List<Integer> inventoryDetailIdList); | |
70 | + | |
71 | + /** | |
72 | + * 批量释放受控 | |
73 | + * @param inventoryDetailIdList 库存明细id | |
74 | + * @return | |
75 | + */ | |
76 | + Result releaseController(List<Integer> inventoryDetailIdList); | |
62 | 77 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java
... | ... | @@ -9,14 +9,20 @@ import java.util.Map; |
9 | 9 | import java.util.function.Function; |
10 | 10 | import java.util.stream.Collectors; |
11 | 11 | |
12 | +import javax.annotation.Resource; | |
13 | + | |
14 | +import org.jeecg.common.api.vo.Result; | |
12 | 15 | import org.jeecg.modules.wms.config.container.entity.Container; |
13 | 16 | import org.jeecg.modules.wms.config.container.service.IContainerService; |
14 | 17 | import org.jeecg.modules.wms.config.containerCapacity.entity.ContainerCapacity; |
15 | 18 | import org.jeecg.modules.wms.config.containerCapacity.service.IContainerCapacityService; |
16 | 19 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
20 | +import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; | |
17 | 21 | import org.jeecg.modules.wms.inventory.inventoryHeader.mapper.InventoryDetailMapper; |
18 | 22 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
23 | +import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; | |
19 | 24 | import org.jeecg.utils.StringUtils; |
25 | +import org.jeecg.utils.constant.QuantityConstant; | |
20 | 26 | import org.springframework.beans.factory.annotation.Autowired; |
21 | 27 | import org.springframework.stereotype.Service; |
22 | 28 | import org.springframework.util.CollectionUtils; |
... | ... | @@ -48,6 +54,9 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
48 | 54 | @Autowired |
49 | 55 | private IContainerCapacityService containerCapacityService; |
50 | 56 | |
57 | + @Resource | |
58 | + private IInventoryHeaderService inventoryHeaderService; | |
59 | + | |
51 | 60 | @Override |
52 | 61 | public List<InventoryDetail> selectByMainId(String mainId) { |
53 | 62 | return inventoryDetailMapper.selectByMainId(mainId); |
... | ... | @@ -96,7 +105,9 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
96 | 105 | .eq(StringUtils.isNotEmpty(inventoryDetail.getBatch()), InventoryDetail::getBatch, inventoryDetail.getBatch()) |
97 | 106 | .eq(StringUtils.isNotEmpty(inventoryDetail.getLot()), InventoryDetail::getLot, inventoryDetail.getLot()) |
98 | 107 | .eq(StringUtils.isNotEmpty(inventoryDetail.getProject()), InventoryDetail::getProject, inventoryDetail.getLot()) |
99 | - .eq(InventoryDetail::getTaskQty, BigDecimal.ZERO).eq(InventoryDetail::getCompanyCode, inventoryDetail.getCompanyCode()); | |
108 | + .eq(InventoryDetail::getController, QuantityConstant.CONTROLLER_NOT_ENABLE) | |
109 | + .eq(InventoryDetail::getContainerStatus, QuantityConstant.STATUS_CONTAINER_EMPTY).eq(InventoryDetail::getTaskQty, BigDecimal.ZERO) | |
110 | + .eq(InventoryDetail::getCompanyCode, inventoryDetail.getCompanyCode()); | |
100 | 111 | List<InventoryDetail> inventoryDetailList = list(inventoryDetailLambdaQueryWrapper); |
101 | 112 | if (inventoryDetailList.size() == 0) { |
102 | 113 | return BigDecimal.ZERO; |
... | ... | @@ -189,4 +200,46 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
189 | 200 | } |
190 | 201 | } |
191 | 202 | } |
203 | + | |
204 | + @Override | |
205 | + public Result controller(List<Integer> inventoryDetailIdList) { | |
206 | + List<InventoryDetail> inventoryDetailList = listByIds(inventoryDetailIdList); | |
207 | + if (StringUtils.isEmpty(inventoryDetailList)) { | |
208 | + return Result.error("没有找到库存详情"); | |
209 | + } | |
210 | + List<InventoryDetail> inventoryDetailUpdateList = new ArrayList<>(); | |
211 | + List<Integer> inventoryHeaderIdList = inventoryDetailList.stream().map(InventoryDetail::getInventoryHeaderId).distinct().collect(Collectors.toList()); | |
212 | + List<InventoryHeader> inventoryHeaderList = inventoryHeaderService.listByIds(inventoryHeaderIdList); | |
213 | + for (InventoryDetail inventoryDetail : inventoryDetailList) { | |
214 | + InventoryDetail inventoryDetail1 = new InventoryDetail(); | |
215 | + inventoryDetail1.setId(inventoryDetail.getId()); | |
216 | + inventoryDetail1.setController(QuantityConstant.CONTROLLER_ENABLE); | |
217 | + inventoryDetailUpdateList.add(inventoryDetail1); | |
218 | + } | |
219 | + boolean success = updateBatchById(inventoryDetailUpdateList); | |
220 | + if (success) { | |
221 | + return Result.ok("批量受控库存成功"); | |
222 | + } | |
223 | + return Result.ok("批量受控库存失败"); | |
224 | + } | |
225 | + | |
226 | + @Override | |
227 | + public Result releaseController(List<Integer> inventoryDetailIdList) { | |
228 | + List<InventoryDetail> inventoryDetailList = listByIds(inventoryDetailIdList); | |
229 | + if (StringUtils.isEmpty(inventoryDetailList)) { | |
230 | + return Result.error("没有找到库存详情"); | |
231 | + } | |
232 | + List<InventoryDetail> inventoryDetailUpdateList = new ArrayList<>(); | |
233 | + for (InventoryDetail inventoryDetail : inventoryDetailList) { | |
234 | + InventoryDetail inventoryDetail1 = new InventoryDetail(); | |
235 | + inventoryDetail1.setId(inventoryDetail.getId()); | |
236 | + inventoryDetail1.setController(QuantityConstant.CONTROLLER_NOT_ENABLE); | |
237 | + inventoryDetailUpdateList.add(inventoryDetail1); | |
238 | + } | |
239 | + boolean success = updateBatchById(inventoryDetailUpdateList); | |
240 | + if (success) { | |
241 | + return Result.ok("批量释放受控库存成功"); | |
242 | + } | |
243 | + return Result.ok("批量释放受控库存失败"); | |
244 | + } | |
192 | 245 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryHeaderServiceImpl.java
... | ... | @@ -7,6 +7,7 @@ import java.util.List; |
7 | 7 | |
8 | 8 | import javax.annotation.Resource; |
9 | 9 | |
10 | +import org.jeecg.common.exception.JeecgBootException; | |
10 | 11 | import org.jeecg.modules.wms.config.container.entity.Container; |
11 | 12 | import org.jeecg.modules.wms.config.container.service.IContainerService; |
12 | 13 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
... | ... | @@ -68,6 +69,7 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
68 | 69 | } |
69 | 70 | |
70 | 71 | @Override |
72 | + @Transactional | |
71 | 73 | public boolean updateInventoryContainerStatusByContainerCode(String containerCode, String warehouseCode) { |
72 | 74 | Container container = containerService.getContainerByCode(containerCode, warehouseCode); |
73 | 75 | if (container == null) { |
... | ... | @@ -75,63 +77,62 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
75 | 77 | } |
76 | 78 | InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); |
77 | 79 | if (inventoryHeader != null) { |
78 | - boolean success = inventoryHeaderService.updateContainerStatusById(container.getStatus(), inventoryHeader.getId()); | |
79 | - if (!success) { | |
80 | - return success; | |
80 | + if (!inventoryHeaderService.updateContainerStatusById(container.getStatus(), inventoryHeader.getId())) { | |
81 | + throw new JeecgBootException("更新库存头表状态失败"); | |
81 | 82 | } |
82 | 83 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByContainerCode(containerCode, warehouseCode); |
83 | - List<InventoryDetail> inventoryDetailList1 = new ArrayList<>(); | |
84 | + List<InventoryDetail> updateInventoryDetailList = new ArrayList<>(); | |
84 | 85 | if (inventoryDetailList.size() > 0) { |
85 | 86 | for (InventoryDetail inventoryDetail : inventoryDetailList) { |
86 | - inventoryDetail.setContainerStatus(container.getStatus()); | |
87 | - InventoryDetail inventoryDetail1 = new InventoryDetail(); | |
88 | - inventoryDetail1.setId(inventoryDetail.getId()); | |
89 | - inventoryDetail1.setContainerStatus(container.getStatus()); | |
90 | - inventoryDetailList1.add(inventoryDetail1); | |
87 | + InventoryDetail updateInventoryDetail = new InventoryDetail(); | |
88 | + updateInventoryDetail.setId(inventoryDetail.getId()); | |
89 | + updateInventoryDetail.setContainerStatus(container.getStatus()); | |
90 | + updateInventoryDetailList.add(updateInventoryDetail); | |
91 | + } | |
92 | + if (!inventoryDetailService.updateBatchById(updateInventoryDetailList)) { | |
93 | + throw new JeecgBootException("更新库存明细表状态失败"); | |
91 | 94 | } |
92 | - success = inventoryDetailService.updateBatchById(inventoryDetailList1); | |
93 | 95 | } |
94 | - return success; | |
95 | 96 | } |
96 | 97 | return true; |
97 | 98 | } |
98 | 99 | |
99 | 100 | @Override |
101 | + @Transactional | |
100 | 102 | public boolean updateInventoryLocationAndZoneById(String locationCode, String zoneCode, Integer id) { |
101 | 103 | InventoryHeader inventoryHeader = new InventoryHeader(); |
102 | 104 | inventoryHeader.setId(id); |
103 | 105 | inventoryHeader.setLocationCode(locationCode); |
104 | 106 | inventoryHeader.setZoneCode(zoneCode); |
105 | - boolean success = inventoryHeaderService.updateById(inventoryHeader); | |
106 | - return success; | |
107 | + return inventoryHeaderService.updateById(inventoryHeader); | |
107 | 108 | } |
108 | 109 | |
109 | 110 | @Override |
111 | + @Transactional | |
110 | 112 | public boolean updateContainerStatusById(String containerStatus, Integer id) { |
111 | 113 | InventoryHeader inventoryHeader = new InventoryHeader(); |
112 | 114 | inventoryHeader.setId(id); |
113 | 115 | inventoryHeader.setContainerStatus(containerStatus); |
114 | - boolean success = inventoryHeaderService.updateById(inventoryHeader); | |
115 | - return success; | |
116 | + return inventoryHeaderService.updateById(inventoryHeader); | |
116 | 117 | } |
117 | 118 | |
118 | 119 | @Override |
120 | + @Transactional | |
119 | 121 | public boolean updateContainerStatusAndLocationCode(String containerStatus, String locationCode, Integer id) { |
120 | 122 | InventoryHeader inventoryHeader = new InventoryHeader(); |
121 | 123 | inventoryHeader.setId(id); |
122 | 124 | inventoryHeader.setContainerStatus(containerStatus); |
123 | 125 | inventoryHeader.setLocationCode(locationCode); |
124 | - boolean success = inventoryHeaderService.updateById(inventoryHeader); | |
125 | - return success; | |
126 | + return inventoryHeaderService.updateById(inventoryHeader); | |
126 | 127 | } |
127 | 128 | |
128 | 129 | @Override |
130 | + @Transactional | |
129 | 131 | public boolean updateLocationCodeById(String locationCode, Integer id) { |
130 | 132 | InventoryHeader inventoryHeader = new InventoryHeader(); |
131 | 133 | inventoryHeader.setId(id); |
132 | 134 | inventoryHeader.setLocationCode(locationCode); |
133 | - boolean success = inventoryHeaderService.updateById(inventoryHeader); | |
134 | - return success; | |
135 | + return inventoryHeaderService.updateById(inventoryHeader); | |
135 | 136 | } |
136 | 137 | |
137 | 138 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java
... | ... | @@ -27,6 +27,8 @@ import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService |
27 | 27 | import org.jeecg.modules.wms.receipt.receiving.domain.Receive; |
28 | 28 | import org.jeecg.modules.wms.receipt.receiving.mapper.ReceiveMapper; |
29 | 29 | import org.jeecg.modules.wms.receipt.receiving.service.IReceiveService; |
30 | +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; | |
31 | +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; | |
30 | 32 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
31 | 33 | import org.jeecg.utils.StringUtils; |
32 | 34 | import org.jeecg.utils.constant.QuantityConstant; |
... | ... | @@ -75,6 +77,8 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl |
75 | 77 | private IParameterConfigurationService parameterConfigurationService; |
76 | 78 | @Resource |
77 | 79 | private IReceiveService receiveService; |
80 | + @Resource | |
81 | + private IShipmentContainerHeaderService shipmentContainerHeaderService; | |
78 | 82 | |
79 | 83 | /** |
80 | 84 | * 组盘后自动生成任务,返回任务实体 |
... | ... | @@ -136,6 +140,10 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl |
136 | 140 | if (containerType == null) { |
137 | 141 | return Result.error("入库组盘,容器类型为空" + containerCode); |
138 | 142 | } |
143 | + ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getUnCompleteShipmentContainerByCode(containerCode, warehouseCode); | |
144 | + if (shipmentContainerHeader != null) { | |
145 | + throw new JeecgBootException("入库组盘,容器" + containerCode + "不能有出库配盘"); | |
146 | + } | |
139 | 147 | int taskType = QuantityConstant.TASK_TYPE_WHOLERECEIPT; |
140 | 148 | String fromLocationCode = container.getLocationCode(); |
141 | 149 | if (StringUtils.isNotEmpty(fromLocationCode)) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java
... | ... | @@ -112,7 +112,8 @@ public class ShipmentCombinationController { |
112 | 112 | @ResponseBody |
113 | 113 | public Result createShipmentTask(@RequestBody ShipmentContainerHeader shipmentContainerHeader, HttpServletRequest req) { |
114 | 114 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); |
115 | - return huahengMultiHandlerService.createShipmentTask(shipmentContainerHeader, warehouseCode, 0, 0, 0); | |
115 | + Result result = huahengMultiHandlerService.createShipmentTask(shipmentContainerHeader, warehouseCode, 0, 0, 0); | |
116 | + return result; | |
116 | 117 | } |
117 | 118 | |
118 | 119 | /** |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/IShipmentCombinationService.java
... | ... | @@ -15,17 +15,17 @@ import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; |
15 | 15 | */ |
16 | 16 | public interface IShipmentCombinationService { |
17 | 17 | |
18 | - public List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail); | |
18 | + List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail); | |
19 | 19 | |
20 | - public Result autoCombination(String shipmentCode, String warehouseCode); | |
20 | + Result autoCombination(String shipmentCode, String warehouseCode); | |
21 | 21 | |
22 | - public Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber); | |
22 | + Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber); | |
23 | 23 | |
24 | - public Result getInventoryFromShipmentDetail(Integer shipmentDetailId); | |
24 | + Result getInventoryFromShipmentDetail(Integer shipmentDetailId); | |
25 | 25 | |
26 | - public Result combination(CombinationModel combinationModel); | |
26 | + Result combination(CombinationModel combinationModel); | |
27 | 27 | |
28 | - public Result autoCombinationDetail(ShipmentDetail shipmentDetail, BigDecimal shipQty); | |
28 | + Result autoCombinationDetail(ShipmentDetail shipmentDetail, BigDecimal shipQty); | |
29 | 29 | |
30 | 30 | ShipmentContainerHeader addShipmentContainerHeader(InventoryDetail inventoryDetail, ShipmentDetail shipmentDetail); |
31 | 31 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -97,6 +97,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
97 | 97 | * @return |
98 | 98 | */ |
99 | 99 | @Override |
100 | + @Transactional(rollbackFor = JeecgBootException.class) | |
100 | 101 | public List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail) { |
101 | 102 | String warehouseCode = shipmentDetail.getWarehouseCode(); |
102 | 103 | String companyCode = shipmentDetail.getCompanyCode(); |
... | ... | @@ -116,7 +117,9 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
116 | 117 | } |
117 | 118 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
118 | 119 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode).eq(InventoryDetail::getCompanyCode, companyCode) |
119 | - .eq(InventoryDetail::getMaterialCode, materialCode).eq(InventoryDetail::getInventoryStatus, inventoryStatus); | |
120 | + .eq(InventoryDetail::getMaterialCode, materialCode).eq(InventoryDetail::getInventoryStatus, inventoryStatus) | |
121 | + .eq(InventoryDetail::getController, QuantityConstant.CONTROLLER_NOT_ENABLE) | |
122 | + .eq(InventoryDetail::getContainerStatus, QuantityConstant.STATUS_CONTAINER_EMPTY); | |
120 | 123 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); |
121 | 124 | return inventoryDetailList; |
122 | 125 | } |
... | ... | @@ -169,7 +172,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
169 | 172 | if (shipQty != null) { |
170 | 173 | shipmentQty = shipQty; |
171 | 174 | } |
172 | - List<InventoryDetail> inventoryList = getInventorys(shipmentDetail); | |
175 | + List<InventoryDetail> inventoryList = shipmentCombinationService.getInventorys(shipmentDetail); | |
173 | 176 | // 去除已锁的库存 |
174 | 177 | ArrayList<InventoryDetail> removeInventoryList = new ArrayList<>(); |
175 | 178 | List<ReceiptContainerHeader> receiptContainerHeaderList = receiptContainerHeaderService.getUnCompleteCombineList(); |
... | ... | @@ -200,7 +203,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
200 | 203 | } |
201 | 204 | inventoryList.removeAll(removeInventoryList); |
202 | 205 | if (inventoryList.size() < 1) { |
203 | - return Result.error(shipmentDetail.getMaterialName() + "' 没有符合出库条件的库存"); | |
206 | + return Result.error(shipmentDetail.getMaterialName() + "没有符合出库条件的库存"); | |
204 | 207 | } |
205 | 208 | |
206 | 209 | for (InventoryDetail inventoryDetail : inventoryList) { |
... | ... | @@ -268,6 +271,10 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
268 | 271 | if (container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) { |
269 | 272 | return Result.error("配盘时, 容器已经锁定,不能再组盘"); |
270 | 273 | } |
274 | + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getUnCompleteReceiptContainerByCode(containerCode, warehouseCode); | |
275 | + if (receiptContainerHeader != null) { | |
276 | + return Result.error("配盘时, 容器有入库组盘不能再组盘,容器编码" + containerCode); | |
277 | + } | |
271 | 278 | BigDecimal shipmentDetailQty = shipmentDetail.getQty(); |
272 | 279 | BigDecimal shipmentDetailTaskQty = shipmentDetail.getTaskQty(); |
273 | 280 | // 可出数量 |
... | ... | @@ -590,13 +597,14 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
590 | 597 | } |
591 | 598 | |
592 | 599 | @Override |
600 | + @Transactional(rollbackFor = JeecgBootException.class) | |
593 | 601 | public Result getInventoryFromShipmentDetail(Integer shipmentDetailId) { |
594 | 602 | ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentDetailId); |
595 | 603 | if (shipmentDetail == null) { |
596 | 604 | return Result.error("找不到出库单详情"); |
597 | 605 | } |
598 | 606 | String warehouseCode = shipmentDetail.getWarehouseCode(); |
599 | - List<InventoryDetail> inventoryDetailList = getInventorys(shipmentDetail); | |
607 | + List<InventoryDetail> inventoryDetailList = shipmentCombinationService.getInventorys(shipmentDetail); | |
600 | 608 | if (inventoryDetailList.size() == 0) { |
601 | 609 | return Result.error("该物料没有库存或没有符合出库规则的库存"); |
602 | 610 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
... | ... | @@ -18,6 +18,8 @@ import org.jeecg.modules.wms.config.material.service.impl.MaterialServiceImpl; |
18 | 18 | import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; |
19 | 19 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
20 | 20 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
21 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; | |
22 | +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; | |
21 | 23 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail; |
22 | 24 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild; |
23 | 25 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.mapper.CycleCountDetailChildMapper; |
... | ... | @@ -73,6 +75,10 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
73 | 75 | private ContainerServiceImpl containerServiceImpl; |
74 | 76 | @Resource |
75 | 77 | private IParameterConfigurationService parameterConfigurationService; |
78 | + @Resource | |
79 | + private IReceiptContainerHeaderService receiptContainerHeaderService; | |
80 | + @Resource | |
81 | + private IShipmentContainerHeaderService shipmentContainerHeaderService; | |
76 | 82 | |
77 | 83 | @Override |
78 | 84 | @Transactional |
... | ... | @@ -224,6 +230,14 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
224 | 230 | if (taskLocationRule == QuantityConstant.RULE_TASK_SET_LOCATION) { |
225 | 231 | toLocationCode = fromLocationCode; |
226 | 232 | } |
233 | + // 校验入库组盘 | |
234 | + if (receiptContainerHeaderService.havaUnCompleteCombineByContainerCode(containerCode, warehouseCode)) { | |
235 | + return Result.error("创建出盘点任务时,容器:" + containerCode + "存在入库组盘,不能移库"); | |
236 | + } | |
237 | + // 校验出库组盘 | |
238 | + if (shipmentContainerHeaderService.havaUnCompleteCombineByContainerCode(containerCode, warehouseCode)) { | |
239 | + return Result.error("创建出盘点任务时, 容器:" + containerCode + "存在出库组盘,不能移库"); | |
240 | + } | |
227 | 241 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_CYCLECOUNT, containerCode, fromLocationCode, toLocationCode, |
228 | 242 | warehouseCode); |
229 | 243 | if (!result.isSuccess()) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
... | ... | @@ -367,8 +367,7 @@ public class TaskHeaderController extends HuahengBaseController { |
367 | 367 | result = handleMultiProcess("cancelTask", new MultiProcessListener() { |
368 | 368 | @Override |
369 | 369 | public Result<?> doProcess() { |
370 | - Result result = taskHeaderService.cancelTask(taskId); | |
371 | - return result; | |
370 | + return taskHeaderService.cancelTask(taskId); | |
372 | 371 | } |
373 | 372 | }); |
374 | 373 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -62,7 +62,6 @@ import org.jeecg.utils.StringUtils; |
62 | 62 | import org.jeecg.utils.constant.QuantityConstant; |
63 | 63 | import org.springframework.beans.factory.annotation.Autowired; |
64 | 64 | import org.springframework.stereotype.Service; |
65 | -import org.springframework.transaction.annotation.Propagation; | |
66 | 65 | import org.springframework.transaction.annotation.Transactional; |
67 | 66 | |
68 | 67 | import com.alibaba.fastjson.JSON; |
... | ... | @@ -298,6 +297,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
298 | 297 | if (container == null) { |
299 | 298 | return Result.error("创建出库查看任务时,容器为空"); |
300 | 299 | } |
300 | + // 校验入库组盘 | |
301 | + if (receiptContainerHeaderService.havaUnCompleteCombineByContainerCode(containerCode, warehouseCode)) { | |
302 | + return Result.error("创建出库查看任务时,容器:" + containerCode + "存在入库组盘,不能移库"); | |
303 | + } | |
304 | + // 校验出库组盘 | |
305 | + if (shipmentContainerHeaderService.havaUnCompleteCombineByContainerCode(containerCode, warehouseCode)) { | |
306 | + return Result.error("创建出库查看任务时, 容器:" + containerCode + "存在出库组盘,不能移库"); | |
307 | + } | |
301 | 308 | String fromLocationCode = container.getLocationCode(); |
302 | 309 | String toLocationCode = QuantityConstant.EMPTY_STRING; |
303 | 310 | String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_LOCATION); |
... | ... | @@ -825,31 +832,21 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
825 | 832 | if (taskHeader.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) { |
826 | 833 | return Result.ok("任务(" + taskId + ")任务已经是完成的!"); |
827 | 834 | } |
828 | - if (taskHeader.getStatus().intValue() > QuantityConstant.TASK_STATUS_BUILD) { | |
829 | - Result result = wcsService.cancelWcsTask(taskHeader); | |
830 | - if (!result.isSuccess()) { | |
831 | - return result; | |
832 | - } | |
833 | - } | |
834 | - int taskType = taskHeader.getTaskType().intValue(); | |
835 | - int preTaskNo = taskId; | |
836 | - String warehouseCode = taskHeader.getWarehouseCode(); | |
837 | - TaskHeader preTaskHeader = getUnCompleteTaskByPreTaskNo(preTaskNo, warehouseCode); | |
835 | + TaskHeader preTaskHeader = getUnCompleteTaskByPreTaskNo(taskId, taskHeader.getWarehouseCode()); | |
838 | 836 | if (preTaskHeader != null) { |
839 | 837 | return Result.error("取消任务失败,有前置任务" + preTaskHeader.getId()); |
840 | 838 | } |
841 | - boolean success = taskHeaderService.removeById(taskId); | |
842 | - if (!success) { | |
843 | - return Result.error("取消任务失败, 删除任务失败"); | |
839 | + if (!taskHeaderService.removeById(taskId)) { | |
840 | + throw new JeecgBootException("取消任务失败, 删除任务失败"); | |
844 | 841 | } |
845 | 842 | List<TaskDetail> taskDetailList = taskDetailService.getTaskDetailListByTaskId(taskId); |
846 | 843 | if (taskDetailList.size() > 0) { |
847 | 844 | List<Integer> taskDetailIdList = taskDetailList.stream().map(TaskDetail::getId).collect(Collectors.toList()); |
848 | - success = taskDetailService.removeByIds(taskDetailIdList); | |
849 | - if (!success) { | |
850 | - return Result.error("取消任务失败, 删除任务详情失败"); | |
845 | + if (!taskDetailService.removeByIds(taskDetailIdList)) { | |
846 | + throw new JeecgBootException("取消任务失败, 删除任务详情失败"); | |
851 | 847 | } |
852 | 848 | } |
849 | + int taskType = taskHeader.getTaskType().intValue(); | |
853 | 850 | Result result = Result.ok("取消任务成功"); |
854 | 851 | switch (taskType) { |
855 | 852 | case QuantityConstant.TASK_TYPE_WHOLERECEIPT: |
... | ... | @@ -862,6 +859,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
862 | 859 | break; |
863 | 860 | } |
864 | 861 | taskHeaderService.cancelLocationAndContainerStatus(taskHeader); |
862 | + if (taskHeader.getStatus().intValue() > QuantityConstant.TASK_STATUS_BUILD) { | |
863 | + result = wcsService.cancelWcsTask(taskHeader); | |
864 | + if (!result.isSuccess()) { | |
865 | + throw new JeecgBootException(result.getMessage()); | |
866 | + } | |
867 | + } | |
865 | 868 | log.info("完成取消任务" + taskHeader.getId()); |
866 | 869 | return result; |
867 | 870 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... | ... | @@ -552,6 +552,11 @@ public class QuantityConstant { |
552 | 552 | /* 不可用 */ |
553 | 553 | public static final int STATUS_DISABLE = 0; |
554 | 554 | |
555 | + /* 库内有托盘 */ | |
556 | + public static final int STATUS_HAVE_CONTAINER = 1; | |
557 | + /* 库内没有托盘 */ | |
558 | + public static final int STATUS_NOT_CONTAINER = 0; | |
559 | + | |
555 | 560 | public static final int HTTP_OK = 200; |
556 | 561 | |
557 | 562 | public static final String URL = "http://erptest.gani.com.cn/K3Cloud/"; |
... | ... | @@ -561,116 +566,28 @@ public class QuantityConstant { |
561 | 566 | public static final String SRC_STOCK_ID_BH = "10237102"; |
562 | 567 | public static final String DEST_STOCK_ID = "10237102"; |
563 | 568 | |
564 | - public static final String PORTGROUP_P1 = "P1"; // 拆垛机1 | |
565 | - public static final String PORTGROUP_P2 = "P2"; // 拆垛机2 | |
566 | - public static final String PORTGROUP_P3 = "P3"; // 拆垛机3 | |
567 | - public static final String PORTGROUP_P11 = "P11"; // 码垛机1 | |
568 | - public static final String PORTGROUP_P12 = "P12"; // 码垛机2 | |
569 | - public static final String PORTGROUP_P13 = "P13"; // 码垛机3 | |
570 | - public static final String PORTGROUP_P30 = "P30"; // 出库到备货区 | |
571 | - public static final String PORTGROUP_P31 = "P31"; // 单片分拣 | |
572 | - public static final String PORTGROUP_P40 = "P40"; // 库内质检到入库缓存区 | |
573 | - | |
574 | - public static final String PORTGROUP_P10 = "P10"; // 异常口 | |
575 | - | |
576 | - public static final String PORT_P1000 = "P1000"; // 入库端 出口 | |
577 | - public static final String PORT_P1004 = "P1004"; // 入库端 出口 | |
578 | - public static final String PORT_P1001 = "P1001"; // 入库端 入口 | |
579 | - public static final String PORT_P1005 = "P1005"; // 入库端 入口 | |
580 | - | |
581 | - public static final int CONTAINER_SPEC_1100 = 1; // 1100*1100木托盘 | |
582 | - public static final int CONTAINER_SPEC_800 = 2; // 800*1135木托盘 | |
583 | - | |
584 | - public static final int MOVE_SLIDER_OR_PAPER = 1; // 把拆盘机的纸皮滑块搬走 | |
585 | - public static final int PUT_SLIDER_OR_PAPER = 2; // 放纸皮滑块到拆盘机 | |
586 | - | |
587 | 569 | public static final String WORK_SHOP = "BM000346"; // 生产车间 |
588 | 570 | // test |
589 | 571 | // public static final String SRC_STOCK_ID_BH = "9988308"; |
590 | 572 | // public static final String SRC_STOCK_ID = "9989058"; |
591 | 573 | // public static final String DEST_STOCK_ID = "9989057"; |
592 | 574 | |
593 | - public static final int CONTAINER_TYPE_SMALL = 0; // 800*1135 | |
594 | - public static final int CONTAINER_TYPE_MIDDLE = 1; // 1100*1100 | |
595 | - public static final int CONTAINER_TYPE_LARGE = 2; | |
596 | - | |
597 | 575 | public static final int AGV_TASK_NOT_CREATE = 0; // 没有创建过AGV任务 |
598 | 576 | public static final int AGV_TASK_ALREADY_CREATE = 1; // 创建过AGV任务 |
599 | 577 | |
600 | 578 | // 第三方打印工具 |
601 | 579 | public static final String PRINT_SERVICE = "PRINT_SERVICE"; |
602 | 580 | |
603 | - // BosAssistantDetail 其他入库类型 key值 | |
604 | - public static final String BOS_ASSISTANT_KEY_QTRKLX = "QTRKLX"; | |
605 | - | |
606 | - // 贴标机1 | |
607 | - public static final String PRINT_ADDRESS_11 = "PRINT_ADDRESS_P11"; | |
608 | - | |
609 | - // 贴标机2 | |
610 | - public static final String PRINT_ADDRESS_12 = "PRINT_ADDRESS_P12"; | |
611 | - | |
612 | - // 贴标机3 | |
613 | - public static final String PRINT_ADDRESS_13 = "PRINT_ADDRESS_P13"; | |
614 | - | |
615 | - // 贴标机3 | |
616 | - public static final Integer PRINT_PORE = 3003; | |
617 | - | |
618 | - // 下载单据参数剥离 | |
619 | - public static final String MATERIAL_FILTERSTRING = "material_FilterString"; | |
620 | - | |
621 | - public static final String CUSTOMER_FILTERSTRING = "customer_FilterString"; | |
622 | - | |
623 | - public static final String USER_FILTERSTRING = "user_FilterString"; | |
624 | - | |
625 | - public static final String DEPT_FILTERSTRING = "dept_FilterString"; | |
626 | - | |
627 | - public static final String PROPACKAGING_FILTERSTRING = "proPackaging_FilterString"; | |
628 | - | |
629 | - public static final String PRODUCTSIZE_FILTERSTRING = "productSize_FilterString"; | |
630 | - | |
631 | - public static final String STOCK_FILTERSTRING = "stock_FilterString"; | |
632 | - | |
633 | - public static final String FLEXVALUES_FILTERSTRING = "flexValues_FilterString"; | |
634 | - | |
635 | - public static final String PRODUCTSCHEDULE_FILTERSTRING = "productSchedule_FilterString"; | |
636 | - public static final String PRODUCTSCHEDULEHEADER_FILTERSTRING = "productScheduleHeader_FilterString"; | |
637 | - public static final String PRODUCTSCHEDULEDETAIL_FILTERSTRING = "productScheduleDetail_FilterString"; | |
638 | - | |
639 | - public static final String UNIT_FILTERSTRING = "unit_FilterString"; | |
640 | - public static final String ACCEPTABLE_PRODUCT_LEVEL = "03"; // 合格品 | |
641 | - | |
642 | - public static final String BOSASSISTANTDETAIL_FILTERSTRING = "bosAssistantDetail_FilterString"; | |
643 | - | |
644 | - public static final String SHIPMENTREQUEST_FILTERSTRING = "shipmentRequest_FilterString"; | |
645 | - | |
646 | - public static final String DEILVERYNOTICE_FILTERSTRING = "deliveryNotice_FilterString"; | |
647 | - | |
648 | - public static final String RETURNNOTICE_FILTERSTRING = "returnNotice_FilterString"; | |
649 | - | |
650 | - public static final String BEFORE_BILL_DATE_NUM = "before_bill_date_num"; | |
651 | - | |
652 | - public static final String MAXIMIM_NUMBER_OF_SLICES = "maximum_number_of_slices"; | |
653 | - | |
654 | - public static final String ERP_RETURN_QTY = "erp_Return_Qty"; | |
655 | - | |
656 | - public static final String DEBUG_SERVER = "debug_Server"; | |
657 | - | |
658 | - public static final String ERP_K3CLOUD_SAVE = "ERP_K3CLOUD_SAVE"; | |
659 | - public static final String ERP_K3CLOUD_POST = "ERP_K3CLOUD_POST"; | |
660 | - public static final String ERP_K3CLOUD_QUERY = "ERP_K3CLOUD_QUERY"; | |
661 | - public static final String ERP_K3CLOUD_LOGIN = "ERP_K3CLOUD_LOGIN"; | |
662 | - public static final String ERP_SESSION_ID = "SESSION_ID"; | |
663 | - | |
664 | - public static final String ERP_AcctID = "62ac23107f9b3a"; | |
665 | - public static final String ERP_AppID = "229087_551NSbjs7PCe29Up2/QCV/UG6tW+WAtu"; | |
666 | - public static final String ERP_AppSec = "d7c33e41b2ff47d09273163d8e55e45c"; | |
667 | - public static final String ERP_UserName = "productadmin"; | |
668 | - public static final String ERP_PASSWORD = "123123"; | |
669 | - public static final String ERP_LCID = "2052"; | |
670 | - public static final String ERP_ServerUrl = "http://erptest.gani.com.cn/K3Cloud/"; | |
671 | - | |
672 | 581 | public static final String UPSTREAM_DELETE_RECEIPT = "上游删除"; |
673 | 582 | public static final String BACK_DELETE_RECEIPT = "回传删除"; |
674 | 583 | public static final String WMS_DELETE_RECEIPT = "WMS删除"; |
675 | 584 | |
585 | + /** | |
586 | + * 不受控 | |
587 | + */ | |
588 | + public static final int CONTROLLER_NOT_ENABLE = 0; | |
589 | + /** | |
590 | + * 受控,受控的库存详情不能出库 | |
591 | + */ | |
592 | + public static final int CONTROLLER_ENABLE = 1; | |
676 | 593 | } |
... | ... |