Commit 0e5c43977494f3bd4283544b7a0f0f21537934f6
1 parent
3b4dda90
曾加受控库存
Showing
12 changed files
with
120 additions
and
20 deletions
ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue
@@ -37,6 +37,13 @@ | @@ -37,6 +37,13 @@ | ||
37 | </a-tag> | 37 | </a-tag> |
38 | </span> | 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 | <span slot="companyCode" slot-scope="companyCode"> | 47 | <span slot="companyCode" slot-scope="companyCode"> |
41 | <a-tag :key="companyCode" color="blue"> | 48 | <a-tag :key="companyCode" color="blue"> |
42 | {{ solutionCompany(companyCode) }} | 49 | {{ solutionCompany(companyCode) }} |
@@ -192,6 +199,12 @@ export default { | @@ -192,6 +199,12 @@ export default { | ||
192 | scopedSlots: {customRender: 'inventoryStatus_dictText'} | 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 | title: '批次', | 208 | title: '批次', |
196 | align: 'center', | 209 | align: 'center', |
197 | dataIndex: 'batch' | 210 | dataIndex: 'batch' |
ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue
@@ -49,6 +49,15 @@ | @@ -49,6 +49,15 @@ | ||
49 | </a-form-item> | 49 | </a-form-item> |
50 | </a-col> | 50 | </a-col> |
51 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 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 | <a-form-item label="物料编码"> | 61 | <a-form-item label="物料编码"> |
53 | <a-input placeholder="请输入物料编码" v-model="queryParam.materialCode"></a-input> | 62 | <a-input placeholder="请输入物料编码" v-model="queryParam.materialCode"></a-input> |
54 | </a-form-item> | 63 | </a-form-item> |
@@ -146,10 +155,10 @@ | @@ -146,10 +155,10 @@ | ||
146 | 155 | ||
147 | <!-- table区域-begin --> | 156 | <!-- table区域-begin --> |
148 | <div> | 157 | <div> |
149 | - <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> | ||
150 | - <!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项--> | ||
151 | - <!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>--> | ||
152 | - <!-- </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> | ||
153 | 162 | ||
154 | <a-table | 163 | <a-table |
155 | ref="table" | 164 | ref="table" |
@@ -161,9 +170,16 @@ | @@ -161,9 +170,16 @@ | ||
161 | :dataSource="dataSource" | 170 | :dataSource="dataSource" |
162 | :pagination="ipagination" | 171 | :pagination="ipagination" |
163 | :loading="loading" | 172 | :loading="loading" |
173 | + :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" | ||
164 | class="j-table-force-nowrap" | 174 | class="j-table-force-nowrap" |
165 | @change="handleTableChange" | 175 | @change="handleTableChange" |
166 | > | 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 | + | ||
167 | <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> | 183 | <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> |
168 | <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> | 184 | <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> |
169 | {{ inventoryStatus_dictText }} | 185 | {{ inventoryStatus_dictText }} |
@@ -218,7 +234,8 @@ import {mixinDevice} from '@/utils/mixin' | @@ -218,7 +234,8 @@ import {mixinDevice} from '@/utils/mixin' | ||
218 | import {JeecgListMixin} from '@/mixins/JeecgListMixin' | 234 | import {JeecgListMixin} from '@/mixins/JeecgListMixin' |
219 | import SimpleInventoryDetailModal from './modules/SimpleInventoryDetailModal' | 235 | import SimpleInventoryDetailModal from './modules/SimpleInventoryDetailModal' |
220 | import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | 236 | import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
221 | -import {getCompanyList, getZoneList} from "@api/api"; | 237 | +import {getCompanyList, getZoneList, } from "@api/api"; |
238 | +import {postAction} from '@/api/manage' | ||
222 | 239 | ||
223 | export default { | 240 | export default { |
224 | name: 'InventoryDetailList', | 241 | name: 'InventoryDetailList', |
@@ -310,6 +327,12 @@ export default { | @@ -310,6 +327,12 @@ export default { | ||
310 | scopedSlots: {customRender: 'inventoryStatus_dictText'} | 327 | scopedSlots: {customRender: 'inventoryStatus_dictText'} |
311 | }, | 328 | }, |
312 | { | 329 | { |
330 | + title: '受控状态', | ||
331 | + align: 'center', | ||
332 | + dataIndex: 'controller_dictText', | ||
333 | + scopedSlots: {customRender: 'controller_dictText'} | ||
334 | + }, | ||
335 | + { | ||
313 | title: '批次', | 336 | title: '批次', |
314 | align: 'center', | 337 | align: 'center', |
315 | dataIndex: 'batch' | 338 | dataIndex: 'batch' |
@@ -521,6 +544,7 @@ export default { | @@ -521,6 +544,7 @@ export default { | ||
521 | fieldList.push({type: 'BigDecimal', value: 'qty', text: '数量', dictCode: ''}) | 544 | fieldList.push({type: 'BigDecimal', value: 'qty', text: '数量', dictCode: ''}) |
522 | fieldList.push({type: 'BigDecimal', value: 'taskQty', text: '任务锁定数量', dictCode: ''}) | 545 | fieldList.push({type: 'BigDecimal', value: 'taskQty', text: '任务锁定数量', dictCode: ''}) |
523 | fieldList.push({type: 'string', value: 'inventoryStatus', text: '库存状态', dictCode: 'inventory_status'}) | 546 | fieldList.push({type: 'string', value: 'inventoryStatus', text: '库存状态', dictCode: 'inventory_status'}) |
547 | + fieldList.push({type: 'int', value: 'controller', text: '受控状态', dictCode: 'inventory_controller'}) | ||
524 | fieldList.push({type: 'string', value: 'batch', text: '批次', dictCode: ''}) | 548 | fieldList.push({type: 'string', value: 'batch', text: '批次', dictCode: ''}) |
525 | // fieldList.push({type:'string',value:'sn',text:'序列号',dictCode:''}) | 549 | // fieldList.push({type:'string',value:'sn',text:'序列号',dictCode:''}) |
526 | fieldList.push({type: 'datetime', value: 'receiptDate', text: '入库日期'}) | 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,6 +243,9 @@ public class WcsServiceImpl implements WcsService { | ||
243 | // 如果是外侧库位,那么就要判断该库位对应的内侧库位是不是有托盘 | 243 | // 如果是外侧库位,那么就要判断该库位对应的内侧库位是不是有托盘 |
244 | if (rowFlag == QuantityConstant.ROW_OUT) { | 244 | if (rowFlag == QuantityConstant.ROW_OUT) { |
245 | Location insideLocation = locationService.getInsideNear(location); | 245 | Location insideLocation = locationService.getInsideNear(location); |
246 | + if (insideLocation == null) { | ||
247 | + return Result.error("分配库位时" + locationCode + "没有找到对应的内侧库位"); | ||
248 | + } | ||
246 | if (StringUtils.isNotEmpty(insideLocation.getContainerCode())) { | 249 | if (StringUtils.isNotEmpty(insideLocation.getContainerCode())) { |
247 | Location destinationLocation = locationService.getEmptyLocation(insideLocation); | 250 | Location destinationLocation = locationService.getEmptyLocation(insideLocation); |
248 | if (destinationLocation == null) { | 251 | if (destinationLocation == null) { |
@@ -348,6 +351,9 @@ public class WcsServiceImpl implements WcsService { | @@ -348,6 +351,9 @@ public class WcsServiceImpl implements WcsService { | ||
348 | if (rowFlag == QuantityConstant.ROW_OUT) { | 351 | if (rowFlag == QuantityConstant.ROW_OUT) { |
349 | // 找到对应内侧库位 | 352 | // 找到对应内侧库位 |
350 | Location insideLocation = locationService.getInsideNear(fromLocation); | 353 | Location insideLocation = locationService.getInsideNear(fromLocation); |
354 | + if (insideLocation == null) { | ||
355 | + return Result.error("分配库位时" + fromLocation + "没有找到对应的内侧库位"); | ||
356 | + } | ||
351 | String insideLocationCode = insideLocation.getCode(); | 357 | String insideLocationCode = insideLocation.getCode(); |
352 | // 如果对应内侧库位有托盘 | 358 | // 如果对应内侧库位有托盘 |
353 | if (StringUtils.isNotEmpty(insideLocation.getContainerCode())) { | 359 | if (StringUtils.isNotEmpty(insideLocation.getContainerCode())) { |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryDetail.java
@@ -127,6 +127,7 @@ public class InventoryDetail implements Serializable { | @@ -127,6 +127,7 @@ public class InventoryDetail implements Serializable { | ||
127 | private Integer inventoryAge; | 127 | private Integer inventoryAge; |
128 | /** 受控 */ | 128 | /** 受控 */ |
129 | @Excel(name = "受控", width = 15) | 129 | @Excel(name = "受控", width = 15) |
130 | + @Dict(dicCode = "inventory_controller") | ||
130 | @ApiModelProperty(value = "受控") | 131 | @ApiModelProperty(value = "受控") |
131 | private Integer controller; | 132 | private Integer controller; |
132 | /** 备用字段1 */ | 133 | /** 备用字段1 */ |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java
@@ -69,7 +69,8 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { | @@ -69,7 +69,8 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { | ||
69 | Result controller(List<Integer> inventoryDetailIdList); | 69 | Result controller(List<Integer> inventoryDetailIdList); |
70 | 70 | ||
71 | /** | 71 | /** |
72 | - * @param | 72 | + * 批量释放受控 |
73 | + * @param inventoryDetailIdList 库存明细id | ||
73 | * @return | 74 | * @return |
74 | */ | 75 | */ |
75 | Result releaseController(List<Integer> inventoryDetailIdList); | 76 | Result releaseController(List<Integer> inventoryDetailIdList); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java
@@ -105,7 +105,9 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | @@ -105,7 +105,9 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | ||
105 | .eq(StringUtils.isNotEmpty(inventoryDetail.getBatch()), InventoryDetail::getBatch, inventoryDetail.getBatch()) | 105 | .eq(StringUtils.isNotEmpty(inventoryDetail.getBatch()), InventoryDetail::getBatch, inventoryDetail.getBatch()) |
106 | .eq(StringUtils.isNotEmpty(inventoryDetail.getLot()), InventoryDetail::getLot, inventoryDetail.getLot()) | 106 | .eq(StringUtils.isNotEmpty(inventoryDetail.getLot()), InventoryDetail::getLot, inventoryDetail.getLot()) |
107 | .eq(StringUtils.isNotEmpty(inventoryDetail.getProject()), InventoryDetail::getProject, inventoryDetail.getLot()) | 107 | .eq(StringUtils.isNotEmpty(inventoryDetail.getProject()), InventoryDetail::getProject, inventoryDetail.getLot()) |
108 | - .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()); | ||
109 | List<InventoryDetail> inventoryDetailList = list(inventoryDetailLambdaQueryWrapper); | 111 | List<InventoryDetail> inventoryDetailList = list(inventoryDetailLambdaQueryWrapper); |
110 | if (inventoryDetailList.size() == 0) { | 112 | if (inventoryDetailList.size() == 0) { |
111 | return BigDecimal.ZERO; | 113 | return BigDecimal.ZERO; |
@@ -223,6 +225,21 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | @@ -223,6 +225,21 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | ||
223 | 225 | ||
224 | @Override | 226 | @Override |
225 | public Result releaseController(List<Integer> inventoryDetailIdList) { | 227 | public Result releaseController(List<Integer> inventoryDetailIdList) { |
226 | - return null; | 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("批量释放受控库存失败"); | ||
227 | } | 244 | } |
228 | } | 245 | } |
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,6 +27,8 @@ import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService | ||
27 | import org.jeecg.modules.wms.receipt.receiving.domain.Receive; | 27 | import org.jeecg.modules.wms.receipt.receiving.domain.Receive; |
28 | import org.jeecg.modules.wms.receipt.receiving.mapper.ReceiveMapper; | 28 | import org.jeecg.modules.wms.receipt.receiving.mapper.ReceiveMapper; |
29 | import org.jeecg.modules.wms.receipt.receiving.service.IReceiveService; | 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 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; | 32 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
31 | import org.jeecg.utils.StringUtils; | 33 | import org.jeecg.utils.StringUtils; |
32 | import org.jeecg.utils.constant.QuantityConstant; | 34 | import org.jeecg.utils.constant.QuantityConstant; |
@@ -75,6 +77,8 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl | @@ -75,6 +77,8 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl | ||
75 | private IParameterConfigurationService parameterConfigurationService; | 77 | private IParameterConfigurationService parameterConfigurationService; |
76 | @Resource | 78 | @Resource |
77 | private IReceiveService receiveService; | 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,6 +140,10 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl | ||
136 | if (containerType == null) { | 140 | if (containerType == null) { |
137 | return Result.error("入库组盘,容器类型为空" + containerCode); | 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 | int taskType = QuantityConstant.TASK_TYPE_WHOLERECEIPT; | 147 | int taskType = QuantityConstant.TASK_TYPE_WHOLERECEIPT; |
140 | String fromLocationCode = container.getLocationCode(); | 148 | String fromLocationCode = container.getLocationCode(); |
141 | if (StringUtils.isNotEmpty(fromLocationCode)) { | 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,7 +112,8 @@ public class ShipmentCombinationController { | ||
112 | @ResponseBody | 112 | @ResponseBody |
113 | public Result createShipmentTask(@RequestBody ShipmentContainerHeader shipmentContainerHeader, HttpServletRequest req) { | 113 | public Result createShipmentTask(@RequestBody ShipmentContainerHeader shipmentContainerHeader, HttpServletRequest req) { |
114 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | 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,17 +15,17 @@ import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; | ||
15 | */ | 15 | */ |
16 | public interface IShipmentCombinationService { | 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 | ShipmentContainerHeader addShipmentContainerHeader(InventoryDetail inventoryDetail, ShipmentDetail shipmentDetail); | 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,6 +97,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
97 | * @return | 97 | * @return |
98 | */ | 98 | */ |
99 | @Override | 99 | @Override |
100 | + @Transactional(rollbackFor = JeecgBootException.class) | ||
100 | public List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail) { | 101 | public List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail) { |
101 | String warehouseCode = shipmentDetail.getWarehouseCode(); | 102 | String warehouseCode = shipmentDetail.getWarehouseCode(); |
102 | String companyCode = shipmentDetail.getCompanyCode(); | 103 | String companyCode = shipmentDetail.getCompanyCode(); |
@@ -116,7 +117,9 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -116,7 +117,9 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
116 | } | 117 | } |
117 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | 118 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
118 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode).eq(InventoryDetail::getCompanyCode, companyCode) | 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 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | 123 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); |
121 | return inventoryDetailList; | 124 | return inventoryDetailList; |
122 | } | 125 | } |
@@ -169,7 +172,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -169,7 +172,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
169 | if (shipQty != null) { | 172 | if (shipQty != null) { |
170 | shipmentQty = shipQty; | 173 | shipmentQty = shipQty; |
171 | } | 174 | } |
172 | - List<InventoryDetail> inventoryList = getInventorys(shipmentDetail); | 175 | + List<InventoryDetail> inventoryList = shipmentCombinationService.getInventorys(shipmentDetail); |
173 | // 去除已锁的库存 | 176 | // 去除已锁的库存 |
174 | ArrayList<InventoryDetail> removeInventoryList = new ArrayList<>(); | 177 | ArrayList<InventoryDetail> removeInventoryList = new ArrayList<>(); |
175 | List<ReceiptContainerHeader> receiptContainerHeaderList = receiptContainerHeaderService.getUnCompleteCombineList(); | 178 | List<ReceiptContainerHeader> receiptContainerHeaderList = receiptContainerHeaderService.getUnCompleteCombineList(); |
@@ -200,7 +203,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -200,7 +203,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
200 | } | 203 | } |
201 | inventoryList.removeAll(removeInventoryList); | 204 | inventoryList.removeAll(removeInventoryList); |
202 | if (inventoryList.size() < 1) { | 205 | if (inventoryList.size() < 1) { |
203 | - return Result.error(shipmentDetail.getMaterialName() + "' 没有符合出库条件的库存"); | 206 | + return Result.error(shipmentDetail.getMaterialName() + "没有符合出库条件的库存"); |
204 | } | 207 | } |
205 | 208 | ||
206 | for (InventoryDetail inventoryDetail : inventoryList) { | 209 | for (InventoryDetail inventoryDetail : inventoryList) { |
@@ -268,6 +271,10 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -268,6 +271,10 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
268 | if (container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) { | 271 | if (container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) { |
269 | return Result.error("配盘时, 容器已经锁定,不能再组盘"); | 272 | return Result.error("配盘时, 容器已经锁定,不能再组盘"); |
270 | } | 273 | } |
274 | + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getUnCompleteReceiptContainerByCode(containerCode, warehouseCode); | ||
275 | + if (receiptContainerHeader != null) { | ||
276 | + return Result.error("配盘时, 容器有入库组盘不能再组盘,容器编码" + containerCode); | ||
277 | + } | ||
271 | BigDecimal shipmentDetailQty = shipmentDetail.getQty(); | 278 | BigDecimal shipmentDetailQty = shipmentDetail.getQty(); |
272 | BigDecimal shipmentDetailTaskQty = shipmentDetail.getTaskQty(); | 279 | BigDecimal shipmentDetailTaskQty = shipmentDetail.getTaskQty(); |
273 | // 可出数量 | 280 | // 可出数量 |
@@ -590,13 +597,14 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -590,13 +597,14 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
590 | } | 597 | } |
591 | 598 | ||
592 | @Override | 599 | @Override |
600 | + @Transactional(rollbackFor = JeecgBootException.class) | ||
593 | public Result getInventoryFromShipmentDetail(Integer shipmentDetailId) { | 601 | public Result getInventoryFromShipmentDetail(Integer shipmentDetailId) { |
594 | ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentDetailId); | 602 | ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentDetailId); |
595 | if (shipmentDetail == null) { | 603 | if (shipmentDetail == null) { |
596 | return Result.error("找不到出库单详情"); | 604 | return Result.error("找不到出库单详情"); |
597 | } | 605 | } |
598 | String warehouseCode = shipmentDetail.getWarehouseCode(); | 606 | String warehouseCode = shipmentDetail.getWarehouseCode(); |
599 | - List<InventoryDetail> inventoryDetailList = getInventorys(shipmentDetail); | 607 | + List<InventoryDetail> inventoryDetailList = shipmentCombinationService.getInventorys(shipmentDetail); |
600 | if (inventoryDetailList.size() == 0) { | 608 | if (inventoryDetailList.size() == 0) { |
601 | return Result.error("该物料没有库存或没有符合出库规则的库存"); | 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,6 +18,8 @@ import org.jeecg.modules.wms.config.material.service.impl.MaterialServiceImpl; | ||
18 | import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; | 18 | import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; |
19 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 19 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
20 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 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 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail; | 23 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail; |
22 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild; | 24 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild; |
23 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.mapper.CycleCountDetailChildMapper; | 25 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.mapper.CycleCountDetailChildMapper; |
@@ -73,6 +75,10 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap | @@ -73,6 +75,10 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap | ||
73 | private ContainerServiceImpl containerServiceImpl; | 75 | private ContainerServiceImpl containerServiceImpl; |
74 | @Resource | 76 | @Resource |
75 | private IParameterConfigurationService parameterConfigurationService; | 77 | private IParameterConfigurationService parameterConfigurationService; |
78 | + @Resource | ||
79 | + private IReceiptContainerHeaderService receiptContainerHeaderService; | ||
80 | + @Resource | ||
81 | + private IShipmentContainerHeaderService shipmentContainerHeaderService; | ||
76 | 82 | ||
77 | @Override | 83 | @Override |
78 | @Transactional | 84 | @Transactional |
@@ -224,6 +230,14 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap | @@ -224,6 +230,14 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap | ||
224 | if (taskLocationRule == QuantityConstant.RULE_TASK_SET_LOCATION) { | 230 | if (taskLocationRule == QuantityConstant.RULE_TASK_SET_LOCATION) { |
225 | toLocationCode = fromLocationCode; | 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 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_CYCLECOUNT, containerCode, fromLocationCode, toLocationCode, | 241 | Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_CYCLECOUNT, containerCode, fromLocationCode, toLocationCode, |
228 | warehouseCode); | 242 | warehouseCode); |
229 | if (!result.isSuccess()) { | 243 | if (!result.isSuccess()) { |
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,7 +62,6 @@ import org.jeecg.utils.StringUtils; | ||
62 | import org.jeecg.utils.constant.QuantityConstant; | 62 | import org.jeecg.utils.constant.QuantityConstant; |
63 | import org.springframework.beans.factory.annotation.Autowired; | 63 | import org.springframework.beans.factory.annotation.Autowired; |
64 | import org.springframework.stereotype.Service; | 64 | import org.springframework.stereotype.Service; |
65 | -import org.springframework.transaction.annotation.Propagation; | ||
66 | import org.springframework.transaction.annotation.Transactional; | 65 | import org.springframework.transaction.annotation.Transactional; |
67 | 66 | ||
68 | import com.alibaba.fastjson.JSON; | 67 | import com.alibaba.fastjson.JSON; |
@@ -298,6 +297,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -298,6 +297,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
298 | if (container == null) { | 297 | if (container == null) { |
299 | return Result.error("创建出库查看任务时,容器为空"); | 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 | String fromLocationCode = container.getLocationCode(); | 308 | String fromLocationCode = container.getLocationCode(); |
302 | String toLocationCode = QuantityConstant.EMPTY_STRING; | 309 | String toLocationCode = QuantityConstant.EMPTY_STRING; |
303 | String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_LOCATION); | 310 | String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_LOCATION); |