Commit 8b024bf187fe8d4196e74caddc2871adaf0e1f0b
Merge remote-tracking branch 'origin/develop' into develop
Showing
17 changed files
with
183 additions
and
50 deletions
ant-design-vue-jeecg/src/views/system/config/modules/LocationHighForm.vue
@@ -15,7 +15,11 @@ | @@ -15,7 +15,11 @@ | ||
15 | </a-col> | 15 | </a-col> |
16 | <a-col :span="24"> | 16 | <a-col :span="24"> |
17 | <a-form-model-item label="库位类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationTypeCode"> | 17 | <a-form-model-item label="库位类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationTypeCode"> |
18 | - <a-input v-model="model.locationTypeCode" placeholder="请输入库位类型"></a-input> | 18 | + <a-select |
19 | + v-model="model.locationTypeCode" | ||
20 | + :options="locationTypeList" | ||
21 | + placeholder="请选择库位类型"> | ||
22 | + </a-select> | ||
19 | </a-form-model-item> | 23 | </a-form-model-item> |
20 | </a-col> | 24 | </a-col> |
21 | <a-col :span="24"> | 25 | <a-col :span="24"> |
@@ -52,7 +56,7 @@ | @@ -52,7 +56,7 @@ | ||
52 | 56 | ||
53 | import {httpAction, getAction} from '@/api/manage' | 57 | import {httpAction, getAction} from '@/api/manage' |
54 | import {validateDuplicateValue} from '@/utils/util' | 58 | import {validateDuplicateValue} from '@/utils/util' |
55 | -import {getContainerTypeList, getZoneList} from "@api/api"; | 59 | +import {getContainerTypeList, getLocationTypeList, getZoneList} from "@api/api"; |
56 | 60 | ||
57 | export default { | 61 | export default { |
58 | name: 'LocationHighForm', | 62 | name: 'LocationHighForm', |
@@ -69,6 +73,7 @@ export default { | @@ -69,6 +73,7 @@ export default { | ||
69 | return { | 73 | return { |
70 | model: {}, | 74 | model: {}, |
71 | zoneList: [], | 75 | zoneList: [], |
76 | + locationTypeList: [], | ||
72 | labelCol: { | 77 | labelCol: { |
73 | xs: {span: 24}, | 78 | xs: {span: 24}, |
74 | sm: {span: 5}, | 79 | sm: {span: 5}, |
@@ -86,7 +91,10 @@ export default { | @@ -86,7 +91,10 @@ export default { | ||
86 | {required: true, message: '请输入名称!'}, | 91 | {required: true, message: '请输入名称!'}, |
87 | ], | 92 | ], |
88 | locationTypeCode: [ | 93 | locationTypeCode: [ |
89 | - {required: true, message: '请输入库位类型!'}, | 94 | + {required: true, message: '请选择库位类型!'}, |
95 | + ], | ||
96 | + zoneCode: [ | ||
97 | + {required: true, message: '请选择库区!'}, | ||
90 | ], | 98 | ], |
91 | high: [ | 99 | high: [ |
92 | {required: true, message: '请输入高度值!'}, | 100 | {required: true, message: '请输入高度值!'}, |
@@ -123,6 +131,13 @@ export default { | @@ -123,6 +131,13 @@ export default { | ||
123 | this.zoneList = res.result | 131 | this.zoneList = res.result |
124 | } | 132 | } |
125 | }); | 133 | }); |
134 | + getLocationTypeList().then((res) => { | ||
135 | + if (res.success) { | ||
136 | + this.locationTypeList = res.result.map((item, index, arr) => { | ||
137 | + return {label: item.name, value: item.code} | ||
138 | + }) | ||
139 | + } | ||
140 | + }); | ||
126 | }, | 141 | }, |
127 | submitForm() { | 142 | submitForm() { |
128 | const that = this; | 143 | const that = this; |
ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue
@@ -79,8 +79,8 @@ | @@ -79,8 +79,8 @@ | ||
79 | 79 | ||
80 | <span slot="action" slot-scope="text, record"> | 80 | <span slot="action" slot-scope="text, record"> |
81 | <a v-has="'inventoryDetail:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a> | 81 | <a v-has="'inventoryDetail:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a> |
82 | - <a v-has="'inventoryDetail:addInventoryDetail'" @click="addInventoryDetail(record)">新增数量<a-divider type="vertical"/></a> | ||
83 | - <a v-has="'inventoryDetail:reduceInventoryDetail'" @click="reduceInventoryDetail(record)">减少数量<a-divider type="vertical"/></a> | 82 | + <a v-has="'inventoryDetail:addInventoryDetail'" v-if="(record.containerStatus == 'lock')" @click="addInventoryDetail(record)">新增数量<a-divider type="vertical"/></a> |
83 | + <a v-has="'inventoryDetail:reduceInventoryDetail'" v-if="(record.containerStatus == 'lock')" @click="reduceInventoryDetail(record)">减少数量<a-divider type="vertical"/></a> | ||
84 | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | 84 | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
85 | <a v-has="'inventoryDetail:delete'">删除</a> | 85 | <a v-has="'inventoryDetail:delete'">删除</a> |
86 | </a-popconfirm> | 86 | </a-popconfirm> |
ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue
@@ -61,15 +61,15 @@ | @@ -61,15 +61,15 @@ | ||
61 | </a-form-item> | 61 | </a-form-item> |
62 | </a-col> | 62 | </a-col> |
63 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 63 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
64 | - <a-form-item label="库存状态"> | ||
65 | - <j-dict-select-tag placeholder="请选择库存状态" v-model="queryParam.inventoryStatus" | ||
66 | - dictCode="inventory_status"/> | 64 | + <a-form-item label="物料编码"> |
65 | + <a-input placeholder="请输入物料编码" v-model="queryParam.materialCode"></a-input> | ||
67 | </a-form-item> | 66 | </a-form-item> |
68 | </a-col> | 67 | </a-col> |
69 | <template v-if="toggleSearchStatus"> | 68 | <template v-if="toggleSearchStatus"> |
70 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 69 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
71 | - <a-form-item label="物料编码"> | ||
72 | - <a-input placeholder="请输入物料编码" v-model="queryParam.materialCode"></a-input> | 70 | + <a-form-item label="库存状态"> |
71 | + <j-dict-select-tag placeholder="请选择库存状态" v-model="queryParam.inventoryStatus" | ||
72 | + dictCode="inventory_status"/> | ||
73 | </a-form-item> | 73 | </a-form-item> |
74 | </a-col> | 74 | </a-col> |
75 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 75 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
@@ -93,6 +93,11 @@ | @@ -93,6 +93,11 @@ | ||
93 | </a-form-item> | 93 | </a-form-item> |
94 | </a-col> | 94 | </a-col> |
95 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 95 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
96 | + <a-form-item label="序列号"> | ||
97 | + <a-input placeholder="请输入序列号" v-model="queryParam.sn"></a-input> | ||
98 | + </a-form-item> | ||
99 | + </a-col> | ||
100 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
96 | <a-form-item label="创建人"> | 101 | <a-form-item label="创建人"> |
97 | <a-input placeholder="请输入创建人" v-model="queryParam.createBy"></a-input> | 102 | <a-input placeholder="请输入创建人" v-model="queryParam.createBy"></a-input> |
98 | </a-form-item> | 103 | </a-form-item> |
@@ -306,6 +311,11 @@ export default { | @@ -306,6 +311,11 @@ export default { | ||
306 | dataIndex: 'materialUnit' | 311 | dataIndex: 'materialUnit' |
307 | }, | 312 | }, |
308 | { | 313 | { |
314 | + title: '序列号', | ||
315 | + align: "center", | ||
316 | + dataIndex: 'sn' | ||
317 | + }, | ||
318 | + { | ||
309 | title: '库存状态', | 319 | title: '库存状态', |
310 | align: "center", | 320 | align: "center", |
311 | dataIndex: 'inventoryStatus_dictText', | 321 | dataIndex: 'inventoryStatus_dictText', |
@@ -327,7 +337,7 @@ export default { | @@ -327,7 +337,7 @@ export default { | ||
327 | dataIndex: 'shipmentQty' | 337 | dataIndex: 'shipmentQty' |
328 | }, | 338 | }, |
329 | { | 339 | { |
330 | - title: '库存数量', | 340 | + title: '库存总数', |
331 | align: "center", | 341 | align: "center", |
332 | dataIndex: 'inventoryQty' | 342 | dataIndex: 'inventoryQty' |
333 | }, | 343 | }, |
ant-design-vue-jeecg/src/views/system/inventory/modules/InventoryDetailModifyModal.vue
ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
@@ -56,6 +56,11 @@ | @@ -56,6 +56,11 @@ | ||
56 | <a-input placeholder="请输入目标出入口" v-model="queryParam.toPortCode"></a-input> | 56 | <a-input placeholder="请输入目标出入口" v-model="queryParam.toPortCode"></a-input> |
57 | </a-form-item> | 57 | </a-form-item> |
58 | </a-col> | 58 | </a-col> |
59 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
60 | + <a-form-item label="入库单ID"> | ||
61 | + <a-input placeholder="请输入入库单ID" v-model="queryParam.receiptId"></a-input> | ||
62 | + </a-form-item> | ||
63 | + </a-col> | ||
59 | <a-col :xl="12" :lg="14" :md="16" :sm="24"> | 64 | <a-col :xl="12" :lg="14" :md="16" :sm="24"> |
60 | <a-form-item label="创建日期"> | 65 | <a-form-item label="创建日期"> |
61 | <j-date :show-date="true" date-format="YYYY-MM-DD" placeholder="请选择开始时间" | 66 | <j-date :show-date="true" date-format="YYYY-MM-DD" placeholder="请选择开始时间" |
ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
@@ -56,6 +56,11 @@ | @@ -56,6 +56,11 @@ | ||
56 | <a-input placeholder="请输入目标出入口" v-model="queryParam.toPortCode"></a-input> | 56 | <a-input placeholder="请输入目标出入口" v-model="queryParam.toPortCode"></a-input> |
57 | </a-form-item> | 57 | </a-form-item> |
58 | </a-col> | 58 | </a-col> |
59 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
60 | + <a-form-item label="出库单ID"> | ||
61 | + <a-input placeholder="请输入出库单ID" v-model="queryParam.shipmentId"></a-input> | ||
62 | + </a-form-item> | ||
63 | + </a-col> | ||
59 | <a-col :xl="12" :lg="14" :md="16" :sm="24"> | 64 | <a-col :xl="12" :lg="14" :md="16" :sm="24"> |
60 | <a-form-item label="创建日期"> | 65 | <a-form-item label="创建日期"> |
61 | <j-date :show-date="true" date-format="YYYY-MM-DD" placeholder="请选择开始时间" | 66 | <j-date :show-date="true" date-format="YYYY-MM-DD" placeholder="请选择开始时间" |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationService.java
@@ -5,14 +5,20 @@ import java.util.List; | @@ -5,14 +5,20 @@ import java.util.List; | ||
5 | public interface LocationAllocationService { | 5 | public interface LocationAllocationService { |
6 | 6 | ||
7 | /** | 7 | /** |
8 | - * 获得库位分配的库位 | 8 | + * 库位分配 |
9 | */ | 9 | */ |
10 | String allocation(int locationRule, List<String> locationTypeCodeList, int high, String zoneCode, List<Integer> raodWays, String warehouseCode, | 10 | String allocation(int locationRule, List<String> locationTypeCodeList, int high, String zoneCode, List<Integer> raodWays, String warehouseCode, |
11 | String containerCode, String materialAreaCode, String materialCode, boolean bypass); | 11 | String containerCode, String materialAreaCode, String materialCode, boolean bypass); |
12 | 12 | ||
13 | + /** | ||
14 | + * 双伸位库位分配 | ||
15 | + */ | ||
13 | String doubleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, | 16 | String doubleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, |
14 | String materialCode, boolean bypass); | 17 | String materialCode, boolean bypass); |
15 | 18 | ||
19 | + /** | ||
20 | + * 单伸位库位分配 | ||
21 | + */ | ||
16 | String singleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, | 22 | String singleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, |
17 | String materialCode); | 23 | String materialCode); |
18 | 24 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java
@@ -28,10 +28,10 @@ import org.jeecg.utils.StringUtils; | @@ -28,10 +28,10 @@ import org.jeecg.utils.StringUtils; | ||
28 | import org.jeecg.utils.constant.QuantityConstant; | 28 | import org.jeecg.utils.constant.QuantityConstant; |
29 | import org.springframework.stereotype.Service; | 29 | import org.springframework.stereotype.Service; |
30 | import org.springframework.transaction.annotation.Transactional; | 30 | import org.springframework.transaction.annotation.Transactional; |
31 | -import org.springframework.util.CollectionUtils; | ||
32 | 31 | ||
33 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 32 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
34 | import com.baomidou.mybatisplus.core.metadata.IPage; | 33 | import com.baomidou.mybatisplus.core.metadata.IPage; |
34 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
35 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 35 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
36 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 36 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
37 | 37 | ||
@@ -93,7 +93,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -93,7 +93,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
93 | case QuantityConstant.SINGLE_FORK: | 93 | case QuantityConstant.SINGLE_FORK: |
94 | return locationAllocationService.singleRk(zoneCode, raodWays, high, warehouseCode, mergelocationTypeCodeList, materialAreaCode, materialCode); | 94 | return locationAllocationService.singleRk(zoneCode, raodWays, high, warehouseCode, mergelocationTypeCodeList, materialAreaCode, materialCode); |
95 | } | 95 | } |
96 | - return null; | 96 | + throw new JeecgBootException("分配库位时, 没有找到分配规则"); |
97 | } | 97 | } |
98 | 98 | ||
99 | /** | 99 | /** |
@@ -103,7 +103,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -103,7 +103,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
103 | @Transactional(rollbackFor = Exception.class) | 103 | @Transactional(rollbackFor = Exception.class) |
104 | public String doubleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, | 104 | public String doubleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, |
105 | String materialCode, boolean bypass) { | 105 | String materialCode, boolean bypass) { |
106 | - if (roadWays == null || roadWays.size() < 1) { | 106 | + if (CollectionUtils.isEmpty(roadWays)) { |
107 | roadWays = locationService.getRoadWayByZoneCode(zoneCode, warehouseCode); | 107 | roadWays = locationService.getRoadWayByZoneCode(zoneCode, warehouseCode); |
108 | } | 108 | } |
109 | String value = parameterConfigurationService.getValueByCode(QuantityConstant.DOUBLE_FORK_RESERVE_LOCATION); | 109 | String value = parameterConfigurationService.getValueByCode(QuantityConstant.DOUBLE_FORK_RESERVE_LOCATION); |
@@ -128,7 +128,6 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -128,7 +128,6 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
128 | LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); | 128 | LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); |
129 | locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode).eq(Location::getWarehouseCode, warehouseCode).eq(Location::getRoadWay, roadWay) | 129 | locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode).eq(Location::getWarehouseCode, warehouseCode).eq(Location::getRoadWay, roadWay) |
130 | .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY).ge(Location::getHigh, high).eq(Location::getEnable, QuantityConstant.STATUS_ENABLE) | 130 | .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY).ge(Location::getHigh, high).eq(Location::getEnable, QuantityConstant.STATUS_ENABLE) |
131 | - .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode) | ||
132 | .in(Location::getLocationTypeCode, locationTypeCodeList).eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING) | 131 | .in(Location::getLocationTypeCode, locationTypeCodeList).eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING) |
133 | .orderByAsc(true, Location::getHigh).orderByAsc(true, Location::getLayer).orderByAsc(true, Location::getId); | 132 | .orderByAsc(true, Location::getHigh).orderByAsc(true, Location::getLayer).orderByAsc(true, Location::getId); |
134 | Page<Location> page = new Page<Location>(1, searchNumber, false); | 133 | Page<Location> page = new Page<Location>(1, searchNumber, false); |
@@ -154,7 +153,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -154,7 +153,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
154 | IPage iPage = locationService.page(page, locationLambda); | 153 | IPage iPage = locationService.page(page, locationLambda); |
155 | List<Location> locationList = iPage.getRecords(); | 154 | List<Location> locationList = iPage.getRecords(); |
156 | List<Location> removeLocaationList = new ArrayList<>(); | 155 | List<Location> removeLocaationList = new ArrayList<>(); |
157 | - if (locationList.size() > 0) { | 156 | + if (CollectionUtils.isNotEmpty(locationList)) { |
158 | for (Location location1 : locationList) { | 157 | for (Location location1 : locationList) { |
159 | // 旁边有任务的库位,不能用来分配库位 | 158 | // 旁边有任务的库位,不能用来分配库位 |
160 | if (taskHeaderService.haveUncompleteTaskInNear(location1)) { | 159 | if (taskHeaderService.haveUncompleteTaskInNear(location1)) { |
@@ -163,7 +162,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -163,7 +162,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
163 | } | 162 | } |
164 | } | 163 | } |
165 | locationList.removeAll(removeLocaationList); | 164 | locationList.removeAll(removeLocaationList); |
166 | - if (locationList.size() == 0) { | 165 | + if (CollectionUtils.isEmpty(locationList)) { |
167 | locationLambda = Wrappers.lambdaQuery(); | 166 | locationLambda = Wrappers.lambdaQuery(); |
168 | locationLambda.eq(Location::getZoneCode, zoneCode).eq(Location::getWarehouseCode, warehouseCode).eq(Location::getRoadWay, roadWay) | 167 | locationLambda.eq(Location::getZoneCode, zoneCode).eq(Location::getWarehouseCode, warehouseCode).eq(Location::getRoadWay, roadWay) |
169 | .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY).ge(Location::getHigh, high).eq(Location::getEnable, QuantityConstant.STATUS_ENABLE) | 168 | .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY).ge(Location::getHigh, high).eq(Location::getEnable, QuantityConstant.STATUS_ENABLE) |
@@ -174,7 +173,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -174,7 +173,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
174 | iPage = locationService.page(page, locationLambda); | 173 | iPage = locationService.page(page, locationLambda); |
175 | locationList = iPage.getRecords(); | 174 | locationList = iPage.getRecords(); |
176 | removeLocaationList = new ArrayList<>(); | 175 | removeLocaationList = new ArrayList<>(); |
177 | - if (locationList != null && locationList.size() > 0) { | 176 | + if (CollectionUtils.isNotEmpty(locationList)) { |
178 | for (Location location1 : locationList) { | 177 | for (Location location1 : locationList) { |
179 | if (taskHeaderService.haveUncompleteTaskInNear(location1)) { | 178 | if (taskHeaderService.haveUncompleteTaskInNear(location1)) { |
180 | removeLocaationList.add(location1); | 179 | removeLocaationList.add(location1); |
@@ -183,8 +182,8 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -183,8 +182,8 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
183 | } | 182 | } |
184 | locationList.removeAll(removeLocaationList); | 183 | locationList.removeAll(removeLocaationList); |
185 | } | 184 | } |
186 | - if (locationList == null || locationList.size() == 0) { | ||
187 | - return null; | 185 | + if (CollectionUtils.isEmpty(locationList)) { |
186 | + throw new JeecgBootException("分配库位时,没有高度值" + high + "的库位可分配"); | ||
188 | } | 187 | } |
189 | Location location = locationList.stream().findFirst().orElse(null); | 188 | Location location = locationList.stream().findFirst().orElse(null); |
190 | return location.getCode(); | 189 | return location.getCode(); |
@@ -197,7 +196,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -197,7 +196,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
197 | @Transactional(rollbackFor = Exception.class) | 196 | @Transactional(rollbackFor = Exception.class) |
198 | public String singleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, | 197 | public String singleRk(String zoneCode, List<Integer> roadWays, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode, |
199 | String materialCode) { | 198 | String materialCode) { |
200 | - if (roadWays == null || roadWays.size() < 1) { | 199 | + if (CollectionUtils.isEmpty(roadWays)) { |
201 | roadWays = locationService.getRoadWayByZoneCode(zoneCode, warehouseCode); | 200 | roadWays = locationService.getRoadWayByZoneCode(zoneCode, warehouseCode); |
202 | } | 201 | } |
203 | List<Integer> removeRoadWays = new ArrayList<>(); | 202 | List<Integer> removeRoadWays = new ArrayList<>(); |
@@ -212,12 +211,12 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -212,12 +211,12 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
212 | Page<Location> page = new Page<Location>(1, 10, false); | 211 | Page<Location> page = new Page<Location>(1, 10, false); |
213 | IPage page1 = locationService.page(page, locationLambdaQueryWrapper); | 212 | IPage page1 = locationService.page(page, locationLambdaQueryWrapper); |
214 | List<Location> totalLocationList = page1.getRecords(); | 213 | List<Location> totalLocationList = page1.getRecords(); |
215 | - if (totalLocationList.size() <= 0) { | 214 | + if (CollectionUtils.isEmpty(totalLocationList)) { |
216 | removeRoadWays.add(roadWay); | 215 | removeRoadWays.add(roadWay); |
217 | } | 216 | } |
218 | } | 217 | } |
219 | roadWays.removeAll(removeRoadWays); | 218 | roadWays.removeAll(removeRoadWays); |
220 | - if (roadWays == null || roadWays.size() == 0) { | 219 | + if (CollectionUtils.isEmpty(roadWays)) { |
221 | throw new JeecgBootException("分配库位时, 可用巷道为空"); | 220 | throw new JeecgBootException("分配库位时, 可用巷道为空"); |
222 | } | 221 | } |
223 | Integer roadWay = locationAllocationService.getRoadWay(roadWays, materialCode, zoneCode, warehouseCode); | 222 | Integer roadWay = locationAllocationService.getRoadWay(roadWays, materialCode, zoneCode, warehouseCode); |
@@ -231,8 +230,8 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -231,8 +230,8 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
231 | Page page = new Page<Location>(1, 1, 1, false); | 230 | Page page = new Page<Location>(1, 1, 1, false); |
232 | IPage iPage = locationService.page(page, locationLambdaQueryWrapper); | 231 | IPage iPage = locationService.page(page, locationLambdaQueryWrapper); |
233 | List<Location> locationList = iPage.getRecords(); | 232 | List<Location> locationList = iPage.getRecords(); |
234 | - if (locationList == null || locationList.size() == 0) { | ||
235 | - return null; | 233 | + if (CollectionUtils.isEmpty(locationList)) { |
234 | + throw new JeecgBootException("分配库位时,没有高度值" + high + "的库位可分配"); | ||
236 | } | 235 | } |
237 | Location location = locationList.stream().findFirst().orElse(null); | 236 | Location location = locationList.stream().findFirst().orElse(null); |
238 | return location.getCode(); | 237 | return location.getCode(); |
@@ -302,7 +301,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -302,7 +301,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
302 | taskHeaderLambdaQueryWrapper.lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED).eq(TaskHeader::getZoneCode, zoneCode) | 301 | taskHeaderLambdaQueryWrapper.lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED).eq(TaskHeader::getZoneCode, zoneCode) |
303 | .ne(TaskHeader::getToLocationCode, QuantityConstant.EMPTY_STRING); | 302 | .ne(TaskHeader::getToLocationCode, QuantityConstant.EMPTY_STRING); |
304 | List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); | 303 | List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); |
305 | - if (taskHeaderList.size() != 0) { | 304 | + if (CollectionUtils.isNotEmpty(taskHeaderList)) { |
306 | List<Integer> roadWayList = taskHeaderList.stream().map(TaskHeader::getRoadWay).collect(toList()); | 305 | List<Integer> roadWayList = taskHeaderList.stream().map(TaskHeader::getRoadWay).collect(toList()); |
307 | List<Integer> removeRoadWayList = new ArrayList<>(); | 306 | List<Integer> removeRoadWayList = new ArrayList<>(); |
308 | for (Integer roadWay : roadWays) { | 307 | for (Integer roadWay : roadWays) { |
@@ -319,7 +318,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -319,7 +318,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
319 | 318 | ||
320 | @Override | 319 | @Override |
321 | public Integer getRoadWayByMinMaterial(List<Integer> roadWays, String materialCode, String zoneCode, String warehouseCode) { | 320 | public Integer getRoadWayByMinMaterial(List<Integer> roadWays, String materialCode, String zoneCode, String warehouseCode) { |
322 | - if (roadWays == null || roadWays.size() == 0) { | 321 | + if (CollectionUtils.isEmpty(roadWays)) { |
323 | throw new JeecgBootException("分配库位时, 巷道为空"); | 322 | throw new JeecgBootException("分配库位时, 巷道为空"); |
324 | } | 323 | } |
325 | Collections.shuffle(roadWays);// 打乱巷道排序 | 324 | Collections.shuffle(roadWays);// 打乱巷道排序 |
@@ -329,7 +328,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -329,7 +328,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
329 | } | 328 | } |
330 | int min = Integer.MAX_VALUE; | 329 | int min = Integer.MAX_VALUE; |
331 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByMaterialCodeAndZoneCode(materialCode, zoneCode, warehouseCode); | 330 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByMaterialCodeAndZoneCode(materialCode, zoneCode, warehouseCode); |
332 | - if (inventoryDetailList.size() != 0) { | 331 | + if (CollectionUtils.isNotEmpty(inventoryDetailList)) { |
333 | List<Integer> roadWayList = inventoryDetailList.stream().map(InventoryDetail::getRoadWay).collect(toList()); | 332 | List<Integer> roadWayList = inventoryDetailList.stream().map(InventoryDetail::getRoadWay).collect(toList()); |
334 | roadWayList.removeAll(Collections.singleton(null)); | 333 | roadWayList.removeAll(Collections.singleton(null)); |
335 | for (Integer road : roadWays) { | 334 | for (Integer road : roadWays) { |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
@@ -263,17 +263,17 @@ public class WcsServiceImpl implements WcsService { | @@ -263,17 +263,17 @@ public class WcsServiceImpl implements WcsService { | ||
263 | if (StringUtils.isNotEmpty(insideLocation.getContainerCode())) { | 263 | if (StringUtils.isNotEmpty(insideLocation.getContainerCode())) { |
264 | Location destinationLocation = locationService.getEmptyLocation(insideLocation); | 264 | Location destinationLocation = locationService.getEmptyLocation(insideLocation); |
265 | if (destinationLocation == null) { | 265 | if (destinationLocation == null) { |
266 | - throw new JeecgBootException("创建移库任务失败, 目标库位为空"); | 266 | + throw new JeecgBootException("分配库位时,创建移库任务失败目标库位为空"); |
267 | } | 267 | } |
268 | Result<TaskHeader> result = taskHeaderService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode); | 268 | Result<TaskHeader> result = taskHeaderService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode); |
269 | if (!result.isSuccess()) { | 269 | if (!result.isSuccess()) { |
270 | - throw new JeecgBootException("创建移库任务失败"); | 270 | + throw new JeecgBootException("分配库位时,创建移库任务失败"); |
271 | } | 271 | } |
272 | preTaskNo = result.getResult().getId(); | 272 | preTaskNo = result.getResult().getId(); |
273 | taskHeader.setPreTaskNo(preTaskNo); | 273 | taskHeader.setPreTaskNo(preTaskNo); |
274 | success = taskHeaderService.updatePreTaskNoById(preTaskNo, taskHeader.getId()); | 274 | success = taskHeaderService.updatePreTaskNoById(preTaskNo, taskHeader.getId()); |
275 | if (!success) { | 275 | if (!success) { |
276 | - throw new JeecgBootException("更新任务状态失败"); | 276 | + throw new JeecgBootException("分配库位时,更新任务状态失败"); |
277 | } | 277 | } |
278 | } | 278 | } |
279 | } else { | 279 | } else { |
@@ -297,7 +297,7 @@ public class WcsServiceImpl implements WcsService { | @@ -297,7 +297,7 @@ public class WcsServiceImpl implements WcsService { | ||
297 | taskHeader.setWeight(Integer.parseInt(warecellDomain.getWeight())); | 297 | taskHeader.setWeight(Integer.parseInt(warecellDomain.getWeight())); |
298 | taskHeader.setToLocationCode(locationCode); | 298 | taskHeader.setToLocationCode(locationCode); |
299 | if (!taskHeaderService.updateById(taskHeader)) { | 299 | if (!taskHeaderService.updateById(taskHeader)) { |
300 | - throw new JeecgBootException("更新任务头表目标库位失败"); | 300 | + throw new JeecgBootException("分配库位时,更新任务头表目标库位失败"); |
301 | } | 301 | } |
302 | WcsTask wcsTask = new WcsTask(); | 302 | WcsTask wcsTask = new WcsTask(); |
303 | wcsTask.setToLocationCode(locationCode); | 303 | wcsTask.setToLocationCode(locationCode); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java
@@ -38,6 +38,9 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { | @@ -38,6 +38,9 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { | ||
38 | // 求一种物料的库存之和(总数) | 38 | // 求一种物料的库存之和(总数) |
39 | BigDecimal getInventorySumQty(InventoryDetail inventoryDetail); | 39 | BigDecimal getInventorySumQty(InventoryDetail inventoryDetail); |
40 | 40 | ||
41 | + // 求一种物料的托盘库存之和(总数) | ||
42 | + BigDecimal getContainerInventorySumQty(InventoryDetail inventoryDetail); | ||
43 | + | ||
41 | // 求一种物料的库存之和(扣除了配盘数量) | 44 | // 求一种物料的库存之和(扣除了配盘数量) |
42 | BigDecimal getSumQty(InventoryDetail inventoryDetail); | 45 | BigDecimal getSumQty(InventoryDetail inventoryDetail); |
43 | 46 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java
@@ -170,6 +170,21 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | @@ -170,6 +170,21 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | ||
170 | } | 170 | } |
171 | 171 | ||
172 | @Override | 172 | @Override |
173 | + public BigDecimal getContainerInventorySumQty(InventoryDetail inventoryDetail) { | ||
174 | + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
175 | + inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryStatus, inventoryDetail.getInventoryStatus()) | ||
176 | + .eq(InventoryDetail::getMaterialCode, inventoryDetail.getMaterialCode()).eq(InventoryDetail::getWarehouseCode, inventoryDetail.getWarehouseCode()) | ||
177 | + .eq(InventoryDetail::getContainerCode, inventoryDetail.getContainerCode()); | ||
178 | + | ||
179 | + List<InventoryDetail> inventoryDetailList = list(inventoryDetailLambdaQueryWrapper); | ||
180 | + if (inventoryDetailList.size() == 0) { | ||
181 | + return BigDecimal.ZERO; | ||
182 | + } | ||
183 | + BigDecimal totalQty = inventoryDetailList.stream().map(InventoryDetail::getQty).reduce(BigDecimal.ZERO, BigDecimal::add); | ||
184 | + return totalQty; | ||
185 | + } | ||
186 | + | ||
187 | + @Override | ||
173 | public BigDecimal getSumQty(InventoryDetail inventoryDetail) { | 188 | public BigDecimal getSumQty(InventoryDetail inventoryDetail) { |
174 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | 189 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
175 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryStatus, inventoryDetail.getInventoryStatus()) | 190 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryStatus, inventoryDetail.getInventoryStatus()) |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryTransaction/entity/InventoryTransaction.java
@@ -137,9 +137,13 @@ public class InventoryTransaction implements Serializable { | @@ -137,9 +137,13 @@ public class InventoryTransaction implements Serializable { | ||
137 | @Excel(name = "出库数量", width = 15) | 137 | @Excel(name = "出库数量", width = 15) |
138 | @ApiModelProperty(value = "出库数量") | 138 | @ApiModelProperty(value = "出库数量") |
139 | private BigDecimal shipmentQty; | 139 | private BigDecimal shipmentQty; |
140 | - /** 库存数量 */ | ||
141 | - @Excel(name = "库存数量", width = 15) | ||
142 | - @ApiModelProperty(value = "库存数量") | 140 | + /** 托盘库存数量 */ |
141 | + @Excel(name = "托盘库存数量", width = 15) | ||
142 | + @ApiModelProperty(value = "托盘库存数量") | ||
143 | + private BigDecimal containerInventoryQty; | ||
144 | + /** 库存总数 */ | ||
145 | + @Excel(name = "库存总数", width = 15) | ||
146 | + @ApiModelProperty(value = "库存总数") | ||
143 | private BigDecimal inventoryQty; | 147 | private BigDecimal inventoryQty; |
144 | /** 批次, 批次主要用于成品,比如以生产日期为批次 */ | 148 | /** 批次, 批次主要用于成品,比如以生产日期为批次 */ |
145 | @Excel(name = "批次", width = 15) | 149 | @Excel(name = "批次", width = 15) |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
@@ -53,6 +53,7 @@ import org.springframework.web.servlet.ModelAndView; | @@ -53,6 +53,7 @@ import org.springframework.web.servlet.ModelAndView; | ||
53 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 53 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
54 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 54 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
55 | import com.baomidou.mybatisplus.core.metadata.IPage; | 55 | import com.baomidou.mybatisplus.core.metadata.IPage; |
56 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
56 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 57 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
57 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 58 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
58 | 59 | ||
@@ -106,6 +107,28 @@ public class TaskHeaderController extends HuahengBaseController { | @@ -106,6 +107,28 @@ public class TaskHeaderController extends HuahengBaseController { | ||
106 | HuahengJwtUtil.setWarehouseCode(req, taskHeader); | 107 | HuahengJwtUtil.setWarehouseCode(req, taskHeader); |
107 | QueryWrapper<TaskHeader> queryWrapper = QueryGenerator.initQueryWrapper(taskHeader, req.getParameterMap()); | 108 | QueryWrapper<TaskHeader> queryWrapper = QueryGenerator.initQueryWrapper(taskHeader, req.getParameterMap()); |
108 | queryWrapper.orderByDesc("id"); | 109 | queryWrapper.orderByDesc("id"); |
110 | + LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = queryWrapper.lambda(); | ||
111 | + Integer shipmentId = taskHeader.getShipmentId(); | ||
112 | + Integer receiptId = taskHeader.getReceiptId(); | ||
113 | + if (shipmentId != null) { | ||
114 | + List<TaskDetail> taskDetailList = taskDetailService.getTaskDetailListByShipmentId(shipmentId); | ||
115 | + if (CollectionUtils.isNotEmpty(taskDetailList)) { | ||
116 | + List<Integer> taskHeaderIdList = taskDetailList.stream().distinct().map(TaskDetail::getTaskHeaderId).collect(Collectors.toList()); | ||
117 | + if (CollectionUtils.isNotEmpty(taskHeaderIdList)) { | ||
118 | + taskHeaderLambdaQueryWrapper.in(TaskHeader::getId, taskHeaderIdList); | ||
119 | + } | ||
120 | + } | ||
121 | + } | ||
122 | + if (receiptId != null) { | ||
123 | + List<TaskDetail> taskDetailList = taskDetailService.getTaskDetailListByReceiptId(receiptId); | ||
124 | + if (CollectionUtils.isNotEmpty(taskDetailList)) { | ||
125 | + List<Integer> taskHeaderIdList = taskDetailList.stream().distinct().map(TaskDetail::getTaskHeaderId).collect(Collectors.toList()); | ||
126 | + if (CollectionUtils.isNotEmpty(taskHeaderIdList)) { | ||
127 | + taskHeaderLambdaQueryWrapper.in(TaskHeader::getId, taskHeaderIdList); | ||
128 | + } | ||
129 | + } | ||
130 | + } | ||
131 | + | ||
109 | Page<TaskHeader> page = new Page<TaskHeader>(pageNo, pageSize); | 132 | Page<TaskHeader> page = new Page<TaskHeader>(pageNo, pageSize); |
110 | IPage<TaskHeader> pageList = taskHeaderService.page(page, queryWrapper); | 133 | IPage<TaskHeader> pageList = taskHeaderService.page(page, queryWrapper); |
111 | return Result.OK(pageList); | 134 | return Result.OK(pageList); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java
@@ -9,6 +9,7 @@ import org.jeecg.common.aspect.annotation.Dict; | @@ -9,6 +9,7 @@ import org.jeecg.common.aspect.annotation.Dict; | ||
9 | import org.jeecgframework.poi.excel.annotation.Excel; | 9 | import org.jeecgframework.poi.excel.annotation.Excel; |
10 | 10 | ||
11 | import com.baomidou.mybatisplus.annotation.IdType; | 11 | import com.baomidou.mybatisplus.annotation.IdType; |
12 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
12 | import com.baomidou.mybatisplus.annotation.TableId; | 13 | import com.baomidou.mybatisplus.annotation.TableId; |
13 | import com.baomidou.mybatisplus.annotation.TableName; | 14 | import com.baomidou.mybatisplus.annotation.TableName; |
14 | 15 | ||
@@ -190,4 +191,12 @@ public class TaskHeader implements Serializable { | @@ -190,4 +191,12 @@ public class TaskHeader implements Serializable { | ||
190 | /** 完成时间(完成任务时间) */ | 191 | /** 完成时间(完成任务时间) */ |
191 | @ApiModelProperty(value = "完成时间") | 192 | @ApiModelProperty(value = "完成时间") |
192 | private Date completeTime; | 193 | private Date completeTime; |
194 | + /** 出库单ID */ | ||
195 | + @TableField(exist = false) | ||
196 | + @ApiModelProperty(value = "出库单ID") | ||
197 | + private Integer shipmentId; | ||
198 | + /** 入库单ID */ | ||
199 | + @TableField(exist = false) | ||
200 | + @ApiModelProperty(value = "入库单ID") | ||
201 | + private Integer receiptId; | ||
193 | } | 202 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskDetailService.java
1 | package org.jeecg.modules.wms.task.taskHeader.service; | 1 | package org.jeecg.modules.wms.task.taskHeader.service; |
2 | 2 | ||
3 | -import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | -import org.jeecg.modules.wms.config.location.entity.Location; | 3 | +import java.util.List; |
4 | + | ||
5 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; | 5 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; |
6 | 6 | ||
7 | -import java.util.List; | 7 | +import com.baomidou.mybatisplus.extension.service.IService; |
8 | 8 | ||
9 | /** | 9 | /** |
10 | * @Description: 任务详情 | 10 | * @Description: 任务详情 |
@@ -22,4 +22,18 @@ public interface ITaskDetailService extends IService<TaskDetail> { | @@ -22,4 +22,18 @@ public interface ITaskDetailService extends IService<TaskDetail> { | ||
22 | * @return | 22 | * @return |
23 | */ | 23 | */ |
24 | List<TaskDetail> getTaskDetailListByTaskId(Integer id); | 24 | List<TaskDetail> getTaskDetailListByTaskId(Integer id); |
25 | + | ||
26 | + /** | ||
27 | + * 根据出库单ID查询任务明细 | ||
28 | + * @param shipmentId | ||
29 | + * @return | ||
30 | + */ | ||
31 | + List<TaskDetail> getTaskDetailListByShipmentId(Integer shipmentId); | ||
32 | + | ||
33 | + /** | ||
34 | + * 根据出库单ID查询任务明细 | ||
35 | + * @param receiptId | ||
36 | + * @return | ||
37 | + */ | ||
38 | + List<TaskDetail> getTaskDetailListByReceiptId(Integer receiptId); | ||
25 | } | 39 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskDetailServiceImpl.java
1 | package org.jeecg.modules.wms.task.taskHeader.service.impl; | 1 | package org.jeecg.modules.wms.task.taskHeader.service.impl; |
2 | 2 | ||
3 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
5 | -import org.jeecg.modules.wms.config.location.entity.Location; | 3 | +import java.util.List; |
4 | + | ||
5 | +import javax.annotation.Resource; | ||
6 | + | ||
6 | import org.jeecg.modules.wms.config.location.service.ILocationService; | 7 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
7 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; | 8 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; |
8 | -import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; | ||
9 | import org.jeecg.modules.wms.task.taskHeader.mapper.TaskDetailMapper; | 9 | import org.jeecg.modules.wms.task.taskHeader.mapper.TaskDetailMapper; |
10 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService; | 10 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService; |
11 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; | 11 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; |
12 | -import org.jeecg.utils.constant.QuantityConstant; | ||
13 | -import org.springframework.stereotype.Service; | ||
14 | -import java.util.List; | ||
15 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
16 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
13 | +import org.springframework.stereotype.Service; | ||
17 | 14 | ||
18 | -import javax.annotation.Resource; | 15 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
16 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
17 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
19 | 18 | ||
20 | /** | 19 | /** |
21 | * @Description: 任务详情 | 20 | * @Description: 任务详情 |
@@ -46,4 +45,20 @@ public class TaskDetailServiceImpl extends ServiceImpl<TaskDetailMapper, TaskDet | @@ -46,4 +45,20 @@ public class TaskDetailServiceImpl extends ServiceImpl<TaskDetailMapper, TaskDet | ||
46 | return taskDetailList; | 45 | return taskDetailList; |
47 | } | 46 | } |
48 | 47 | ||
48 | + @Override | ||
49 | + public List<TaskDetail> getTaskDetailListByShipmentId(Integer shipmentId) { | ||
50 | + LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
51 | + taskDetailLambdaQueryWrapper.eq(TaskDetail::getShipmentId, shipmentId); | ||
52 | + List<TaskDetail> taskDetailList = list(taskDetailLambdaQueryWrapper); | ||
53 | + return taskDetailList; | ||
54 | + } | ||
55 | + | ||
56 | + @Override | ||
57 | + public List<TaskDetail> getTaskDetailListByReceiptId(Integer receiptId) { | ||
58 | + LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
59 | + taskDetailLambdaQueryWrapper.eq(TaskDetail::getReceiptId, receiptId); | ||
60 | + List<TaskDetail> taskDetailList = list(taskDetailLambdaQueryWrapper); | ||
61 | + return taskDetailList; | ||
62 | + } | ||
63 | + | ||
49 | } | 64 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
@@ -1386,10 +1386,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1386,10 +1386,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1386 | inventoryTransaction.setInventoryStatus(taskDetail.getInventoryStatus()); | 1386 | inventoryTransaction.setInventoryStatus(taskDetail.getInventoryStatus()); |
1387 | inventoryTransaction.setReceiptQty(taskDetail.getQty()); | 1387 | inventoryTransaction.setReceiptQty(taskDetail.getQty()); |
1388 | inventoryTransaction.setQty(taskDetail.getQty()); | 1388 | inventoryTransaction.setQty(taskDetail.getQty()); |
1389 | - // 获得库存数量 | 1389 | + // 获得库存总数 |
1390 | BigDecimal inventoryQty = inventoryDetailService.getInventorySumQty(inventoryDetail); | 1390 | BigDecimal inventoryQty = inventoryDetailService.getInventorySumQty(inventoryDetail); |
1391 | + // 获得物料在这个托盘上的库存数 | ||
1392 | + BigDecimal containerInventoryQty = inventoryDetailService.getContainerInventorySumQty(inventoryDetail); | ||
1391 | inventoryQty = inventoryQty.add(taskDetail.getQty()); | 1393 | inventoryQty = inventoryQty.add(taskDetail.getQty()); |
1394 | + containerInventoryQty = containerInventoryQty.add(taskDetail.getQty()); | ||
1392 | inventoryTransaction.setInventoryQty(inventoryQty); | 1395 | inventoryTransaction.setInventoryQty(inventoryQty); |
1396 | + inventoryTransaction.setContainerInventoryQty(containerInventoryQty); | ||
1393 | inventoryTransactionList.add(inventoryTransaction); | 1397 | inventoryTransactionList.add(inventoryTransaction); |
1394 | } | 1398 | } |
1395 | 1399 | ||
@@ -1620,7 +1624,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1620,7 +1624,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1620 | inventoryTransaction.setQty(taskDetail.getQty()); | 1624 | inventoryTransaction.setQty(taskDetail.getQty()); |
1621 | inventoryTransaction.setShipmentQty(taskDetail.getQty()); | 1625 | inventoryTransaction.setShipmentQty(taskDetail.getQty()); |
1622 | BigDecimal inventoryQty = inventoryDetailService.getInventorySumQty(inventoryDetail); | 1626 | BigDecimal inventoryQty = inventoryDetailService.getInventorySumQty(inventoryDetail); |
1627 | + // 获得物料在这个托盘上的库存数 | ||
1628 | + BigDecimal containerInventoryQty = inventoryDetailService.getContainerInventorySumQty(inventoryDetail); | ||
1623 | inventoryTransaction.setInventoryQty(inventoryQty); | 1629 | inventoryTransaction.setInventoryQty(inventoryQty); |
1630 | + inventoryTransaction.setContainerInventoryQty(containerInventoryQty); | ||
1624 | inventoryTransactionList.add(inventoryTransaction); | 1631 | inventoryTransactionList.add(inventoryTransaction); |
1625 | shipmentIdList.add(taskDetail.getShipmentId()); | 1632 | shipmentIdList.add(taskDetail.getShipmentId()); |
1626 | } | 1633 | } |
@@ -1714,7 +1721,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1714,7 +1721,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1714 | inventoryTransaction.setQty(inventoryDetail.getQty()); | 1721 | inventoryTransaction.setQty(inventoryDetail.getQty()); |
1715 | inventoryTransaction.setShipmentQty(inventoryDetail.getQty()); | 1722 | inventoryTransaction.setShipmentQty(inventoryDetail.getQty()); |
1716 | BigDecimal inventoryQty = inventoryDetailService.getInventorySumQty(inventoryDetail); | 1723 | BigDecimal inventoryQty = inventoryDetailService.getInventorySumQty(inventoryDetail); |
1724 | + // 获得物料在这个托盘上的库存数 | ||
1725 | + BigDecimal containerInventoryQty = inventoryDetailService.getContainerInventorySumQty(inventoryDetail); | ||
1717 | inventoryTransaction.setInventoryQty(inventoryQty); | 1726 | inventoryTransaction.setInventoryQty(inventoryQty); |
1727 | + inventoryTransaction.setContainerInventoryQty(containerInventoryQty); | ||
1718 | inventoryTransactionList.add(inventoryTransaction); | 1728 | inventoryTransactionList.add(inventoryTransaction); |
1719 | if (!inventoryDetailService.removeById(inventoryDetail)) { | 1729 | if (!inventoryDetailService.removeById(inventoryDetail)) { |
1720 | throw new JeecgBootException("完成整盘出库任务,删除库存详情失败" + inventoryDetail.getId()); | 1730 | throw new JeecgBootException("完成整盘出库任务,删除库存详情失败" + inventoryDetail.getId()); |