Commit e8caabdd85d037fdd08ca5ecd5d40ff244e8fc13

Authored by 游杰
1 parent a9e7eadc

解决分库位时,库区问题

src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java
... ... @@ -58,6 +58,15 @@ public class LocationAllocationServiceImpl implements LocationAllocationService
58 58 LocationType locationType1 = locationTypeService.getOne(locationTypeLambdaQueryWrapper);
59 59 locationTypeList.add(locationType1);
60 60 }
  61 + if(area == null) {
  62 + String locationTypeCode = locationTypeList.get(0).getCode();
  63 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  64 + locationLambdaQueryWrapper.eq(Location::getLocationType, locationTypeCode)
  65 + .eq(Location::getDeleted, 0);
  66 + List<Location> locations = locationService.list(locationLambdaQueryWrapper);
  67 + Location location = locations.get(0);
  68 + area = location.getArea();
  69 + }
61 70 switch (locationRule) {
62 71 case Constants.DOUBLE_RK:
63 72 return doubleRk(area, warehouseCode, locationTypeList);
... ...
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
... ... @@ -150,7 +150,7 @@ public class ReceiptContainerHeaderController extends BaseController {
150 150 boolean result = false;
151 151 List<Integer> idList = Arrays.asList(Convert.toIntArray(positionBean.getIds()));
152 152 List<Integer> idsList = idList.stream().distinct().collect(Collectors.toList());
153   - for (int i = 0; i<idsList.size(); i++){
  153 + for (int i = 0; i<idsList.size(); i++) {
154 154 LambdaQueryWrapper<ReceiptContainerDetail> lambda = Wrappers.lambdaQuery();
155 155 lambda.eq(ReceiptContainerDetail::getReceiptContainerId, idsList.get(i));
156 156 List<ReceiptContainerDetail> receiptContainerDetails = receiptContainerDetailService.list(lambda);
... ...
src/main/java/com/huaheng/pc/stompwebsocket/service/StompWebSocketServiceImpl.java
... ... @@ -18,7 +18,7 @@ import java.util.Date;
18 18 import java.util.HashMap;
19 19 import java.util.List;
20 20  
21   -@Service("stompWebSocketService")
  21 +@Service
22 22 public class StompWebSocketServiceImpl extends ServiceImpl<StompMessageMapper, StompMessage> implements StompWebSocketService {
23 23  
24 24 @Autowired
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/ShipmentTaskService.java
... ... @@ -140,7 +140,7 @@ public class ShipmentTaskService {
140 140 TaskHeader task = new TaskHeader();
141 141 task.setTaskType(QuantityConstant.TASK_TYPE_SORTINGSHIPMENT);
142 142 task.setFromLocation(shipmentContainerHeader.getLocationCode());
143   -// task.setToLocation(shipmentContainerHeader.getLocationCode());
  143 + task.setToLocation(shipmentContainerHeader.getLocationCode());
144 144 //判断是否整出任务,钱柜和AGV不能整出
145 145 //表示整出优先
146 146 //判断当前子货箱所有数量是否等于该托盘对应的所有库存的数量,
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... ... @@ -93,6 +93,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
93 93 private WorkTaskService workTaskService;
94 94 @Resource
95 95 private TransferTaskService transferTaskService;
  96 + @Resource
  97 + private ReceivingService receivingService;
96 98  
97 99  
98 100  
... ... @@ -274,7 +276,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
274 276 containerService.update(container, containerUpdateWrapper);
275 277 }
276 278 if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_SHELF) || taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_PICKING)) {
277   - if (StringUtils.isNotEmpty(taskHeader.getToLocation())) {
  279 + if (StringUtils.isNotEmpty(taskHeader.getToLocation()) && taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_SHELF) ) {
278 280 //更新托盘、库位状态
279 281 locationService.updateStatus(taskHeader.getToLocation(), "empty");
280 282 LambdaQueryWrapper<ReceiptContainerHeader> lambda = Wrappers.lambdaQuery();
... ... @@ -396,22 +398,20 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
396 398 //如果已完成则不管
397 399 if (task.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) {
398 400 return AjaxResult.success("任务(" + taskIds[i] + ")任务已经是完成的!");
399   -
400 401 }
401 402 //整盘入库,空托入库库位自动分配
402 403 //整盘入库手动完成分配库位,已分配则略过
403 404 if(task.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLERECEIPT) || task.getTaskType().equals(QuantityConstant.TASK_TYPE_EMPTYRECEIPT)){
404 405 if(StringUtils.isEmpty(task.getToLocation())){
405 406 //自动分配库位
406   - // AjaxResult ajaxResult = this.setLocationCode(task.getId(),0 );
407   - // task.setToLocation((String)ajaxResult.getData());
  407 + AjaxResult ajaxResult = this.setLocationCode(task.getId(),0 );
  408 + task.setToLocation((String)ajaxResult.getData());
408 409 }
409 410 }
410 411 //如果没有库位不能完成
411 412 if (StringUtils.isEmpty(task.getFromLocation()) && StringUtils.isEmpty(task.getToLocation())) {
412 413 throw new ServiceException("任务" + task.getId() + "没有库位,执行中止");
413 414 }
414   -
415 415 this.completeTask(task);
416 416 }
417 417 return AjaxResult.success("完成任务成功!");
... ...
src/main/resources/templates/config/company/edit.html
... ... @@ -16,7 +16,7 @@
16 16 <div class="form-group">
17 17 <label class="col-sm-3 control-label">名称:</label>
18 18 <div class="col-sm-8">
19   - <input id="name" name="name" th:field="*{name}" class="form-control" type="text" readonly="readonly">
  19 + <input id="name" name="name" th:field="*{name}" class="form-control" type="text">
20 20 </div>
21 21 </div>
22 22 <div class="form-group">
... ...
src/main/resources/templates/config/warehouse/edit.html
... ... @@ -14,7 +14,7 @@
14 14 <div class="form-group">
15 15 <label class="col-sm-3 control-label">名称:</label>
16 16 <div class="col-sm-8">
17   - <input id="name" name="name" th:field="*{name}" class="form-control" type="text" readonly="true">
  17 + <input id="name" name="name" th:field="*{name}" class="form-control" type="text">
18 18 </div>
19 19 </div>
20 20 <!--<div class="form-group">-->
... ...
src/main/resources/templates/config/warehouse/warehouse.html
... ... @@ -15,18 +15,6 @@
15 15 <li>
16 16 名称:<input type="text" name="name"/>
17 17 </li>
18   - <!--<li>-->
19   - <!--类型:<select name="type" th:with="type=${@dict.getType('companyType')}">-->
20   - <!--<option value="">所有</option>-->
21   - <!--<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>-->
22   - <!--</select>-->
23   - <!--</li>-->
24   - <!--<li class="time">-->
25   - <!--<label>创建时间: </label>-->
26   - <!--<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="createdBegin"/>-->
27   - <!--<span>-</span>-->
28   - <!--<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="createdEnd"/>-->
29   - <!--</li>-->
30 18 <li>
31 19 <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
32 20 <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('warehouse-form')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
... ...
src/main/resources/templates/login.html
... ... @@ -85,7 +85,7 @@
85 85 </div>
86 86 <div class="signup-footer">
87 87 <div class="pull-left">
88   - &copy; 2020 All Rights Reserved. 长沙华恒机器人系统有限公司
  88 + &copy; 2021 All Rights Reserved. 长沙华恒机器人系统有限公司
89 89 </div>
90 90 </div>
91 91 </div>
... ...
src/main/resources/templates/receipt/receiving/receiving.html
... ... @@ -479,18 +479,31 @@
479 479 }
480 480  
481 481 function positioning() {
482   - let rows = $("#bootstrap-table1").bootstrapTable('getSelections');
483   - if (rows.length == 0) {
484   - $.modal.alertWarning("请至少选择一条记录");
485   - return;
486   - }
487   - var ids = "";
488   - for (var i = 0; i<rows.length; i++){
489   - ids += rows[i].receiptContainerId;
490   - ids += ",";
491   - }
492   - var url = ctx + "/receipt/receiptContainerHeader" + "/positioning" + "/" + ids;
493   - $.modal.open("定位", url);
  482 + let rows = $("#bootstrap-table1").bootstrapTable('getSelections');
  483 + if (rows.length == 0) {
  484 + $.modal.alertWarning("请至少选择一条记录");
  485 + return;
  486 + }
  487 + var url = ctx+"receipt/receiptContainerHeader/position";
  488 + var ids = "";
  489 + for (var i = 0; i<rows.length; i++){
  490 + ids += rows[i].receiptContainerId;
  491 + ids += ",";
  492 + }
  493 + var data = { "ids": ids };
  494 + $.modal.loading("正在处理中,请稍后...");
  495 + var config = {
  496 + url: url,
  497 + type: "post",
  498 + dataType: "json",
  499 + data: data,
  500 + success: function(result) {
  501 + $.operate.ajaxSuccess(result);
  502 + list_receiptInfo($("#code").val());
  503 + }
  504 + };
  505 + $.ajax(config)
  506 + $.table.refresh("bootstrap-table1");
494 507 }
495 508  
496 509 function cancelPositioning() {
... ...