diff --git a/src/main/java/com/huaheng/api/wcs/controller/EmptyOutHandle.java b/src/main/java/com/huaheng/api/wcs/controller/EmptyOutHandle.java index 369aef8..978a27b 100644 --- a/src/main/java/com/huaheng/api/wcs/controller/EmptyOutHandle.java +++ b/src/main/java/com/huaheng/api/wcs/controller/EmptyOutHandle.java @@ -27,10 +27,10 @@ public class EmptyOutHandle extends BaseController { private EmptyOutHandleService emptyOutHandleService; @Log(title = "wcs空出处理", action = BusinessType.INSERT) - @PostMapping("/EmptyOutHandle") + @PostMapping("/emptyOutHandle") @ApiOperation("wcs空出处理") @ResponseBody - public AjaxResult EmptyOutHandle(@RequestBody Map<String,String> map) { + public AjaxResult emptyOutHandle(@RequestBody Map<String,String> map) { String taskNo = map.get("taskNo"); AjaxResult ajaxResult = emptyOutHandleService.EmptyOutHandle(taskNo); return ajaxResult; diff --git a/src/main/java/com/huaheng/api/wcs/domain/TaskFinishDomain.java b/src/main/java/com/huaheng/api/wcs/domain/TaskFinishDomain.java index b47eae1..29117a9 100644 --- a/src/main/java/com/huaheng/api/wcs/domain/TaskFinishDomain.java +++ b/src/main/java/com/huaheng/api/wcs/domain/TaskFinishDomain.java @@ -1,6 +1,7 @@ package com.huaheng.api.wcs.domain; +import com.huaheng.framework.aspectj.lang.annotation.Excel; import lombok.Data; /** diff --git a/src/main/java/com/huaheng/api/wcs/service/overrideHandle/OverrideHandleServiceImpl.java b/src/main/java/com/huaheng/api/wcs/service/overrideHandle/OverrideHandleServiceImpl.java index b3484eb..941f937 100644 --- a/src/main/java/com/huaheng/api/wcs/service/overrideHandle/OverrideHandleServiceImpl.java +++ b/src/main/java/com/huaheng/api/wcs/service/overrideHandle/OverrideHandleServiceImpl.java @@ -111,12 +111,6 @@ public class OverrideHandleServiceImpl implements OverrideHandleService { if(location == null) { return AjaxResult.error("此任务的原目的库位在系统中不存在"); } - location.setStatus(QuantityConstant.STATUS_LOCATION_EMPTY); - location.setContainerCode(""); - Boolean flag = locationService.updateById(location); - if(flag == false) { - return AjaxResult.error("修改此任务的原目的库位错误"); - } /** * 查看新库位有两种情况 * 1、重入的库位由wcs提供 @@ -155,15 +149,20 @@ public class OverrideHandleServiceImpl implements OverrideHandleService { String destination = location.getArea(); String containerCode = taskHeader.getContainerCode(); List<TaskDetail> taskDetailList = taskDetailService.findByTaskId(taskHeader.getId()); - String materialCode = taskDetailList.get(0).getMaterialCode(); - Material material = materialService.findAllByCode(materialCode, warehouseCode); - String materialAreaCode = material.getMaterialAreaCode(); + String materialAreaCode = null; + if(taskDetailList != null && taskDetailList.size() > 0) { + String materialCode = taskDetailList.get(0).getMaterialCode(); + Material material = materialService.findAllByCode(materialCode, warehouseCode); + materialAreaCode = material.getMaterialAreaCode(); + } String locationCode = locationAllocationService.allocation(allocationRule, locationTypeCodeList, high, destination, warehouseCode, containerCode, materialAreaCode); if (StringUtils.isEmpty(locationCode)) { return AjaxResult.error("没有库位可分配"); } - if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_RECEIPT)) { + int taskType = taskHeader.getTaskType(); + if (taskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT || + taskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) { //查询入库组盘明细 List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>(); if(taskDetailList != null) { @@ -182,6 +181,7 @@ public class OverrideHandleServiceImpl implements OverrideHandleService { } newLocationCode = locationCode; } + if (StringUtils.isEmpty(newLocationCode)) { return AjaxResult.error("没有库位可以分配"); } @@ -192,7 +192,10 @@ public class OverrideHandleServiceImpl implements OverrideHandleService { taskHeader.setToLocation(newLocationCode); taskHeader.setExceptionCode("重入处理"); taskHeader.setIsDoubleIn(QuantityConstant.DOUBLE_IN); - taskHeader.setOriginLocation(toLocationCode); + String originLocationCode = taskHeader.getOriginLocation(); + if(StringUtils.isEmpty(originLocationCode)) { + taskHeader.setOriginLocation(toLocationCode); + } if(!taskHeaderService.updateById(taskHeader)){ throw new ServiceException("修改此任务错误"); } diff --git a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java index 2803acb..cd504cd 100644 --- a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java +++ b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java @@ -14,6 +14,8 @@ import com.huaheng.pc.config.location.domain.Location; import com.huaheng.pc.config.location.service.LocationService; import com.huaheng.pc.config.locationType.domain.LocationType; import com.huaheng.pc.config.locationType.service.LocationTypeService; +import com.huaheng.pc.config.zone.domain.Zone; +import com.huaheng.pc.config.zone.service.ZoneService; import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; import org.springframework.stereotype.Service; @@ -37,6 +39,8 @@ public class LocationAllocationServiceImpl implements LocationAllocationService private ContainerTypeService containerTypeService; @Resource private TaskHeaderService taskHeaderService; + @Resource + private ZoneService zoneService; @Override public String allocation(int locationRule, List<String> locationTypeCodeList, @@ -50,17 +54,30 @@ public class LocationAllocationServiceImpl implements LocationAllocationService containerTypeLambdaQueryWrapper.eq(ContainerType::getCode, container.getContainerType()) .eq(ContainerType::getWarehouseCode, warehouseCode); ContainerType containerType = containerTypeService.getOne(containerTypeLambdaQueryWrapper); - - String locationType = containerType.getLocationType(); List<LocationType> locationTypeList = new ArrayList<>(); - String[] list = locationType.split(","); - for(String str : list) { - LambdaQueryWrapper<LocationType> locationTypeLambdaQueryWrapper = Wrappers.lambdaQuery(); - locationTypeLambdaQueryWrapper.eq(LocationType::getWarehouseCode, warehouseCode) - .eq(LocationType::getCode, str); - LocationType locationType1 = locationTypeService.getOne(locationTypeLambdaQueryWrapper); - locationTypeList.add(locationType1); + if(containerType != null) { + String locationType = containerType.getLocationType(); + String[] list = locationType.split(","); + for (String str : list) { + LambdaQueryWrapper<LocationType> locationTypeLambdaQueryWrapper = Wrappers.lambdaQuery(); + locationTypeLambdaQueryWrapper.eq(LocationType::getWarehouseCode, warehouseCode) + .eq(LocationType::getCode, str); + LocationType locationType1 = locationTypeService.getOne(locationTypeLambdaQueryWrapper); + locationTypeList.add(locationType1); + } + } else { + LambdaQueryWrapper<Zone> zoneLambdaQueryWrapper = Wrappers.lambdaQuery(); + zoneLambdaQueryWrapper.eq(Zone::getWarehouseCode, warehouseCode) + .eq(Zone::getArea, area); + Zone zone = zoneService.getOne(zoneLambdaQueryWrapper); + if(zone != null) { + LambdaQueryWrapper<LocationType> locationTypeLambdaQueryWrapper = Wrappers.lambdaQuery(); + locationTypeLambdaQueryWrapper.eq(LocationType::getWarehouseCode, warehouseCode) + .eq(LocationType::getZoneCode, zone.getCode()); + locationTypeList = locationTypeService.list(locationTypeLambdaQueryWrapper); + } } + List<String> locationTypeCodes = locationTypeList.stream(). map(t -> t.getCode()).collect(toList()); List<String> mergelocationTypeCodeList = locationTypeCodeList.stream().filter(item -> locationTypeCodes.contains(item)).collect(toList()); @@ -131,12 +148,4 @@ public class LocationAllocationServiceImpl implements LocationAllocationService return locationCode; } -// private String filter(List<Location> locationList, List<String> locationTypeList, String area) { -// List<Location> newLocation = locationList.stream().filter(t -> locationTypeList.contains(t.getLocationType()) && t.getArea().equals(area)).collect(toList()); -// if (newLocation.isEmpty()) { -// return null; -// } else { -// return newLocation.get(0).getCode(); -// } -// } } diff --git a/src/main/java/com/huaheng/pc/config/address/domain/Address.java b/src/main/java/com/huaheng/pc/config/address/domain/Address.java index 0d56d1d..f3100e9 100644 --- a/src/main/java/com/huaheng/pc/config/address/domain/Address.java +++ b/src/main/java/com/huaheng/pc/config/address/domain/Address.java @@ -33,7 +33,7 @@ public class Address implements Serializable { private String warehouseCode; /** - + /** * 区域 */ @@ -42,9 +42,10 @@ public class Address implements Serializable { private Integer number; /** + * 参数 + */ @TableField(value = "param") @ApiModelProperty(value="参数") - */ private String param; /** @@ -93,4 +94,4 @@ public class Address implements Serializable { public void setArea(Integer area) { this.number = area; } -} \ No newline at end of file +} diff --git a/src/main/java/com/huaheng/pc/config/location/controller/LocationController.java b/src/main/java/com/huaheng/pc/config/location/controller/LocationController.java index cb34735..178448f 100644 --- a/src/main/java/com/huaheng/pc/config/location/controller/LocationController.java +++ b/src/main/java/com/huaheng/pc/config/location/controller/LocationController.java @@ -223,11 +223,11 @@ public class LocationController extends BaseController { @Log(title = "通用-库位管理", operating = "批量修改库位", action = BusinessType.UPDATE) @PostMapping("/editBatchSave") @ResponseBody - public AjaxResult editBatchSave (String ids, String area, Integer high, String status) { + public AjaxResult editBatchSave (String ids, String materialAreaCode, Integer high, String status) { String[] idArray = Convert.toStrArray(ids); LambdaUpdateWrapper<Location> wrapper = Wrappers.lambdaUpdate(); wrapper.in(Location::getId, idArray) - .set(Location::getArea, area) + .set(Location::getMaterialAreaCode, materialAreaCode) .set(Location::getHigh, high) .set(Location::getStatus, status); return toAjax(locationService.update(wrapper)); diff --git a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java index 76b08c9..0405e53 100644 --- a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java +++ b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java @@ -363,15 +363,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea //如果已完成则不管 if (task.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) { return AjaxResult.success("任务(" + taskIds[i] + ")任务已经是完成的!"); - } //整盘入库,空托入库库位自动分配 //整盘入库手动完成分配库位,已分配则略过 - if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLERECEIPT) || task.getTaskType().equals(QuantityConstant.TASK_TYPE_EMPTYRECEIPT)) { + if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLERECEIPT) + || task.getTaskType().equals(QuantityConstant.TASK_TYPE_EMPTYRECEIPT)) { if (StringUtils.isEmpty(task.getToLocation())) { //自动分配库位 - AjaxResult ajaxResult = this.setLocationCode(task.getId(), 0); - task.setToLocation((String) ajaxResult.getData()); +// AjaxResult ajaxResult = this.setLocationCode(task.getId(), 0); +// task.setToLocation((String) ajaxResult.getData()); } } //如果没有库位不能完成 diff --git a/src/main/resources/templates/config/location/editBatch.html b/src/main/resources/templates/config/location/editBatch.html index 84e2755..977eb9f 100644 --- a/src/main/resources/templates/config/location/editBatch.html +++ b/src/main/resources/templates/config/location/editBatch.html @@ -23,11 +23,9 @@ </div> </div> <div class="form-group"> - <label class="col-sm-3 control-label">物料分区:</label> + <label class="col-sm-3 control-label">物料分区编码</label> <div class="col-sm-8"> - <select id="area" name="area" class="form-control" th:with="areas=${@dict.getType('material_areas')}"> - <option th:each="item : ${areas}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option> - </select> + <input id="materialAreaCode" name="materialAreaCode" class="form-control" type="text"> </div> </div> <div class="form-group"> @@ -48,10 +46,10 @@ type : "POST", url : prefix + "/editBatchSave", data : { - "ids": $("input[name='ids']").val(), + "ids" : $("input[name='ids']").val(), + "materialAreaCode" : $("input[name='materialAreaCode']").val(), "high" : $("#high option:selected").val(), "status" : $("#status option:selected").val(), - "area" : $("#area option:selected").val() }, async : false, error : function(request) { diff --git a/src/main/resources/templates/config/location/location.html b/src/main/resources/templates/config/location/location.html index 4eb1e85..6f0199c 100644 --- a/src/main/resources/templates/config/location/location.html +++ b/src/main/resources/templates/config/location/location.html @@ -99,7 +99,7 @@ var datas = [[${@dict.getType('sys_normal_disable')}]]; var rowFlags = [[${@dict.getType('rowFlag')}]]; var high = [[${@dict.getType('high')}]]; - var locationTypes = [[${@dict.getType('locationType')}]]; + var locationTypes = [[${@locationType.getLocationPrefix()}]]; var locationStatus = [[${@dict.getType('locationStatus')}]]; var zone =[[${@zone.getCode()}]]; @@ -126,6 +126,18 @@ title : '库位编码' }, { + field : 'containerCode', + title : '容器编码' + }, + { + field : 'status', + title : '状态' , + align: 'center', + formatter: function(value, row, index) { + return $.table.selectDictLabel(locationStatus, value); + } + }, + { field : 'warehouseCode', title : '仓库', visible : false @@ -142,10 +154,6 @@ field : 'iLayer', title : '层' }, - // { - // field : 'iGrid', - // title : '格' - // }, { field : 'rowFlag', title : '内外侧', @@ -164,21 +172,20 @@ field : 'roadway', title : '巷道' }, - // { - // field : 'area', - // title : '区域' - // }, { field : 'locationType', title : '库位类型' , align: 'center', - formatter: function(value, row, index) { - return $.table.selectDictLabel(locationTypes, value); - } - }, - { - field : 'containerCode', - title : '容器编号' + formatter: function(value, row, index) { + var actions = []; + $.each(locationTypes, function(index, dict) { + if (dict.code == value) { + actions.push("<span class='badge badge-info'>" + dict.name + "</span>"); + return false; + } + }); + return actions.join(''); + } }, { field: 'zoneCode', @@ -196,12 +203,8 @@ } }, { - field : 'status', - title : '状态' , - align: 'center', - formatter: function(value, row, index) { - return $.table.selectDictLabel(locationStatus, value); - } + field : 'materialAreaCode', + title : '物料分区' }, { field : 'lastCycleCountDate', diff --git a/src/main/resources/templates/config/locationType/locationType.html b/src/main/resources/templates/config/locationType/locationType.html index af1a461..496200b 100644 --- a/src/main/resources/templates/config/locationType/locationType.html +++ b/src/main/resources/templates/config/locationType/locationType.html @@ -110,26 +110,6 @@ title : '高m' }, { - field : 'maxWeight', - title : '最大重量kg' - }, - { - field : 'minQtyUm', - title : '最小允许单位' - }, - { - field : 'checkDigit', - title : '校验位' - }, - { - field : 'maxMaterials', - title : '最多混放物料数' - }, - { - field : 'maxContainers', - title : '最大允许托盘数' - }, - { field : 'created', title : '创建时间' }, @@ -138,14 +118,6 @@ title : '创建用户' }, { - field : 'lastUpdated', - title : '更新时间' - }, - { - field : 'lastUpdatedBy', - title : '更新用户' - }, - { field : 'enable', title : '是否有效', formatter: function(value, row, index) { diff --git a/src/main/resources/templates/config/material/edit.html b/src/main/resources/templates/config/material/edit.html index 8ee286f..cc75bd4 100644 --- a/src/main/resources/templates/config/material/edit.html +++ b/src/main/resources/templates/config/material/edit.html @@ -128,36 +128,7 @@ <input id="minShelfLifeDays" name="minShelfLifeDays" class="form-control" type="text" th:field="*{minShelfLifeDays}"> </div> </div> - <!--<div class="form-group"> - <label class="col-sm-3 control-label">数据版本:</label> - <div class="col-sm-8"> - <input id="version" name="version" class="form-control" type="text"> - </div> - </div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">创建时间:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="created" name="created" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">创建用户:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="createdBy" name="createdBy" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">最后修改间:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="lastUpdated" name="lastUpdated" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">更新用户:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="lastUpdatedBy" name="lastUpdatedBy" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> + <div class="form-group"> <label class="col-sm-3 control-label">状态:</label> @@ -171,60 +142,7 @@ </div> </div> </div> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">是否删除:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="deleted" name="deleted" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段1:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef1" name="userDef1" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段2:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef2" name="userDef2" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段3:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef3" name="userDef3" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段4:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef4" name="userDef4" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段5:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef5" name="userDef5" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段6:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef6" name="userDef6" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段7:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef7" name="userDef7" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段8:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef8" name="userDef8" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> + <div class="form-group"> <div class="form-control-static col-sm-offset-9"> <button type="submit" class="btn btn-primary">提交</button>