From bfbdec043d0ae807b67132caadfe4994006347ca Mon Sep 17 00:00:00 2001 From: pengcheng <1432755665@qq.com> Date: Mon, 12 Aug 2019 15:15:21 +0800 Subject: [PATCH] 配置栏下的增删改查 --- src/main/java/com/huaheng/pc/config/containerType/domain/ContainerType.java | 53 +++++++++++++++-------------------------------------- src/main/java/com/huaheng/pc/config/locationType/controller/LocationTypeController.java | 16 ++++++++++++++++ src/main/java/com/huaheng/pc/config/locationType/domain/LocationType.java | 2 +- src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeService.java | 2 -- src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeServiceImpl.java | 9 --------- src/main/resources/templates/config/containerType/add.html | 54 +++++++++++++++--------------------------------------- src/main/resources/templates/config/containerType/containerType.html | 8 ++++---- src/main/resources/templates/config/containerType/edit.html | 43 +++++++++++++++++++------------------------ src/main/resources/templates/config/locationType/add.html | 60 +++++++++++++++++++++++++++++++++++++++--------------------- src/main/resources/templates/config/locationType/edit.html | 34 ++++++++++++++++++++++++++-------- src/main/resources/templates/config/locationType/locationType.html | 38 +++++++++++++++++++++++--------------- src/main/resources/templates/config/zoneCapacity/add.html | 6 ------ 12 files changed, 158 insertions(+), 167 deletions(-) diff --git a/src/main/java/com/huaheng/pc/config/containerType/domain/ContainerType.java b/src/main/java/com/huaheng/pc/config/containerType/domain/ContainerType.java index 3316d0b..397cf14 100644 --- a/src/main/java/com/huaheng/pc/config/containerType/domain/ContainerType.java +++ b/src/main/java/com/huaheng/pc/config/containerType/domain/ContainerType.java @@ -53,7 +53,7 @@ public class ContainerType implements Serializable { */ @TableField(value = "enable") @ApiModelProperty(value="启用;0—禁用状态") - private Integer enable; + private Boolean enable; /** * 序号 @@ -116,7 +116,7 @@ public class ContainerType implements Serializable { */ @TableField(value = "useAsDEFAULT") @ApiModelProperty(value="作为默认货箱") - private Integer useAsDEFAULT; + private Boolean useAsDEFAULT; /** * 状态 @@ -373,23 +373,6 @@ public class ContainerType implements Serializable { this.companyCode = companyCode; } - /** - * 获取启用;0—禁用状态 - * - * @return enable - 启用;0—禁用状态 - */ - public Integer getEnable() { - return enable; - } - - /** - * 设置启用;0—禁用状态 - * - * @param enable 启用;0—禁用状态 - */ - public void setEnable(Integer enable) { - this.enable = enable; - } /** * 获取序号 @@ -517,39 +500,33 @@ public class ContainerType implements Serializable { this.maxWeight = maxWeight; } - /** - * 获取装满度 - * - * @return fillPercent - 装满度 - */ public Integer getFillPercent() { return fillPercent; } - /** - * 设置装满度 - * - * @param fillPercent 装满度 - */ public void setFillPercent(Integer fillPercent) { this.fillPercent = fillPercent; } /** - * 获取作为默认货箱 + * 获取装满度 * - * @return useAsDEFAULT - 作为默认货箱 + * @return fillPercent - 装满度 */ - public Integer getUseAsDEFAULT() { + + public Boolean getEnable() { + return enable; + } + + public void setEnable(Boolean enable) { + this.enable = enable; + } + + public Boolean getUseAsDEFAULT() { return useAsDEFAULT; } - /** - * 设置作为默认货箱 - * - * @param useAsDEFAULT 作为默认货箱 - */ - public void setUseAsDEFAULT(Integer useAsDEFAULT) { + public void setUseAsDEFAULT(Boolean useAsDEFAULT) { this.useAsDEFAULT = useAsDEFAULT; } diff --git a/src/main/java/com/huaheng/pc/config/locationType/controller/LocationTypeController.java b/src/main/java/com/huaheng/pc/config/locationType/controller/LocationTypeController.java index 3458c59..bffb12d 100644 --- a/src/main/java/com/huaheng/pc/config/locationType/controller/LocationTypeController.java +++ b/src/main/java/com/huaheng/pc/config/locationType/controller/LocationTypeController.java @@ -16,6 +16,8 @@ import com.huaheng.framework.web.page.TableDataInfo; import com.huaheng.framework.web.page.TableSupport; 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 org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -38,6 +40,8 @@ public class LocationTypeController extends BaseController @Autowired private LocationTypeService locationTypeService; + @Autowired + private ZoneService zoneService; @RequiresPermissions("config:locationType:view") @GetMapping() @@ -98,6 +102,18 @@ public class LocationTypeController extends BaseController @ResponseBody public AjaxResult addSave(LocationType locationType) { + if(StringUtils.isEmpty(locationType.getCode())){ + return AjaxResult.error("库位类型为空"); + } + //查找location,是否存在 + Zone zone=new Zone(); + LambdaQueryWrapper<Zone> lambdaQueryWrapper = Wrappers.lambdaQuery(); + lambdaQueryWrapper.eq(Zone::getLocationType,locationType.getCode()) + .eq(Zone::getWarehouseCode,ShiroUtils.getWarehouseCode()); + zone=zoneService.getOne(lambdaQueryWrapper); + if(zone==null){ + return AjaxResult.error("系统没有此库位类型"); + } locationType.setWarehouseCode(ShiroUtils.getWarehouseCode()); locationType.setCreatedBy(ShiroUtils.getLoginName()); locationType.setLastUpdatedBy(ShiroUtils.getLoginName()); diff --git a/src/main/java/com/huaheng/pc/config/locationType/domain/LocationType.java b/src/main/java/com/huaheng/pc/config/locationType/domain/LocationType.java index 512226b..0c7e42a 100644 --- a/src/main/java/com/huaheng/pc/config/locationType/domain/LocationType.java +++ b/src/main/java/com/huaheng/pc/config/locationType/domain/LocationType.java @@ -93,7 +93,7 @@ public class LocationType implements Serializable { * 有效 */ @TableField(value = "enable") - private Integer enable; + private Boolean enable; /** * 创建时间 diff --git a/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeService.java b/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeService.java index 6a8cf47..ddab98f 100644 --- a/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeService.java +++ b/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeService.java @@ -7,6 +7,4 @@ import java.util.List; import java.util.Map; public interface LocationTypeService extends IService<LocationType>{ - - List<Map<String,Object>> getLocationPrefix(); } diff --git a/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeServiceImpl.java b/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeServiceImpl.java index a28f5b8..752f571 100644 --- a/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeServiceImpl.java +++ b/src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeServiceImpl.java @@ -14,13 +14,4 @@ import java.util.Map; @Service("locationType") public class LocationTypeServiceImpl extends ServiceImpl<LocationTypeMapper, LocationType> implements LocationTypeService{ - @Override - public List<Map<String, Object>> getLocationPrefix() { - LocationType locationType=new LocationType(); - locationType.setWarehouseCode(ShiroUtils.getWarehouseCode()); - locationType.setEnable(0); - LambdaQueryWrapper<LocationType> lambda = Wrappers.lambdaQuery(locationType); - - return this.listMaps(lambda); - } } diff --git a/src/main/resources/templates/config/containerType/add.html b/src/main/resources/templates/config/containerType/add.html index 3fce751..ce81e17 100644 --- a/src/main/resources/templates/config/containerType/add.html +++ b/src/main/resources/templates/config/containerType/add.html @@ -17,6 +17,12 @@ <input id="name" name="name" 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="sequence" name="sequence" class="form-control" type="text"> + </div> + </div> <!--<div class="form-group"> --> <!--<label class="col-sm-3 control-label">仓库Id:</label>--> <!--<div class="col-sm-8">--> @@ -30,12 +36,6 @@ <!--</div>--> <!--</div>--> <div class="form-group"> - <label class="col-sm-3 control-label">前缀:</label> - <div class="col-sm-8"> - <input id="prefix" name="prefix" class="form-control" type="text"> - </div> - </div> - <div class="form-group"> <label class="col-sm-3 control-label">空箱重量kg:</label> <div class="col-sm-8"> <input id="emptyWeight" name="emptyWeight" class="form-control" type="text"> @@ -71,6 +71,12 @@ <input id="fillPercent" name="fillPercent" 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="status" name="status" class="form-control" type="text"> + </div> + </div> <!--<div class="form-group"> --> <!--<label class="col-sm-3 control-label">作为默认货箱:</label>--> <!--<div class="col-sm-8">--> @@ -81,7 +87,7 @@ <label class="col-sm-3 control-label">是否默认容器:</label> <div class="col-sm-8"> <div class="onoffswitch"> - <input type="checkbox" th:checked="false" class="onoffswitch-checkbox" id="useAsDefault" name="useAsDefault"> + <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="useAsDefault" name="useAsDefault"> <label class="onoffswitch-label" for="useAsDefault"> <span class="onoffswitch-inner"></span> <span class="onoffswitch-switch"></span> @@ -90,36 +96,6 @@ </div> </div> <div class="form-group"> - <label class="col-sm-3 control-label">类型描述:</label> - <div class="col-sm-8"> - <input id="remark" name="remark" 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> <div class="col-sm-8"> <!--<input id="enable" name="enable" class="form-control" type="text">--> @@ -205,14 +181,14 @@ "useAsDefault" : $("input[name='useAsDefault']").is(':checked'), "code" :$("input[name='code']").val(), "name" :$("input[name='name']").val(), - "prefix" :$("input[name='prefix']").val(), + "sequence" :$("input[name='sequence']").val(), "emptyWeight" :$("input[name='emptyWeight']").val(), "length" :$("input[name='length']").val(), "width" :$("input[name='width']").val(), "height" :$("input[name='height']").val(), "maxWeight" :$("input[name='maxWeight']").val(), "fillPercent" :$("input[name='fillPercent']").val(), - "remark" :$("input[name='remark']").val() + "status" :$("input[name='status']").val(), }, async : false, error : function(request) { diff --git a/src/main/resources/templates/config/containerType/containerType.html b/src/main/resources/templates/config/containerType/containerType.html index 5f9e8a2..adc2d2a 100644 --- a/src/main/resources/templates/config/containerType/containerType.html +++ b/src/main/resources/templates/config/containerType/containerType.html @@ -87,6 +87,10 @@ field : 'companyCode', title : '货主编码' }, + { + field : 'sequence', + title : '序号' + }, { field : 'emptyWeight', title : '空箱重量kg' @@ -124,10 +128,6 @@ } }, { - field : 'remark', - title : '类型描述' - }, - { field : 'created', title : '创建时间' }, diff --git a/src/main/resources/templates/config/containerType/edit.html b/src/main/resources/templates/config/containerType/edit.html index 363d3d0..0eb7258 100644 --- a/src/main/resources/templates/config/containerType/edit.html +++ b/src/main/resources/templates/config/containerType/edit.html @@ -30,12 +30,7 @@ <!--<input id="warehouseCode" name="warehouseCode" th:field="*{warehouseCode}" 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="prefix" name="prefix" th:field="*{prefix}" class="form-control" type="text"> - </div> - </div> + <div class="form-group"> <label class="col-sm-3 control-label">空箱重量kg:</label> <div class="col-sm-8"> @@ -78,24 +73,24 @@ <input id="useAsDefault" name="useAsDefault" th:field="*{ }" class="form-control" type="text"> </div> </div>--> - <div class="form-group"> - <label class="col-sm-3 control-label">是否默认容器:</label> - <div class="col-sm-8"> - <div class="onoffswitch"> - <input type="checkbox" th:checked="${containerType.useAsDefault}" class="onoffswitch-checkbox" id="useAsDefault" name="useAsDefault"> - <label class="onoffswitch-label" for="useAsDefault"> - <span class="onoffswitch-inner"></span> - <span class="onoffswitch-switch"></span> - </label> - </div> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">类型描述:</label> - <div class="col-sm-8"> - <input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text"> - </div> - </div> + <!--<div class="form-group">--> + <!--<label class="col-sm-3 control-label">是否默认容器:</label>--> + <!--<div class="col-sm-8">--> + <!--<div class="onoffswitch">--> + <!--<input type="checkbox" th:checked="${containerType.useAsDefault}" class="onoffswitch-checkbox" id="useAsDefault" name="useAsDefault">--> + <!--<label class="onoffswitch-label" for="useAsDefault">--> + <!--<span class="onoffswitch-inner"></span>--> + <!--<span class="onoffswitch-switch"></span>--> + <!--</label>--> + <!--</div>--> + <!--</div>--> + <!--</div>--> + <!--<div class="form-group"> --> + <!--<label class="col-sm-3 control-label">类型描述:</label>--> + <!--<div class="col-sm-8">--> + <!--<input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">--> + <!--</div>--> + <!--</div>--> <!--<div class="form-group"> --> <!--<label class="col-sm-3 control-label">创建时间:</label>--> <!--<div class="col-sm-8">--> diff --git a/src/main/resources/templates/config/locationType/add.html b/src/main/resources/templates/config/locationType/add.html index 7686be5..6abd859 100644 --- a/src/main/resources/templates/config/locationType/add.html +++ b/src/main/resources/templates/config/locationType/add.html @@ -17,12 +17,6 @@ <input id="name" name="name" 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="prefix" name="prefix" class="form-control" type="text"> - </div> - </div> <!--<div class="form-group"> --> <!--<label class="col-sm-3 control-label">仓库Id:</label>--> <!--<div class="col-sm-8">--> @@ -60,9 +54,33 @@ </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"> + <input id="minQtyUm" name="minQtyUm" 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="checkDigit" name="checkDigit" 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="maxMaterials" name="maxMaterials" 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="remark" name="remark" class="form-control" type="text"> + <input id="maxLots" name="maxLots" 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="maxContainers" name="maxContainers" class="form-control" type="text"> </div> </div> <!--<div class="form-group"> --> @@ -89,19 +107,19 @@ <!--<input id="lastUpdatedBy" name="lastUpdatedBy" 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="enable" name="enable" class="form-control" type="text">--> - <div class="onoffswitch"> - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable"> - <label class="onoffswitch-label" for="enable"> - <span class="onoffswitch-inner"></span> - <span class="onoffswitch-switch"></span> - </label> - </div> - </div> - </div> + <!--<div class="form-group"> --> + <!--<label class="col-sm-3 control-label">是否有效:</label>--> + <!--<div class="col-sm-8">--> + <!--<!–<input id="enable" name="enable" class="form-control" type="text">–>--> + <!--<div class="onoffswitch">--> + <!--<input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable">--> + <!--<label class="onoffswitch-label" for="enable">--> + <!--<span class="onoffswitch-inner"></span>--> + <!--<span class="onoffswitch-switch"></span>--> + <!--</label>--> + <!--</div>--> + <!--</div>--> + <!--</div>--> <!--<div class="form-group"> --> <!--<label class="col-sm-3 control-label">是否删除:</label>--> <!--<div class="col-sm-8">--> diff --git a/src/main/resources/templates/config/locationType/edit.html b/src/main/resources/templates/config/locationType/edit.html index 5f0e93c..5bc3128 100644 --- a/src/main/resources/templates/config/locationType/edit.html +++ b/src/main/resources/templates/config/locationType/edit.html @@ -19,12 +19,6 @@ </div> </div> <div class="form-group"> - <label class="col-sm-3 control-label">前缀:</label> - <div class="col-sm-8"> - <input id="prefix" name="prefix" th:field="*{prefix}" class="form-control" type="text"> - </div> - </div> - <div class="form-group"> <label class="col-sm-3 control-label">长m:</label> <div class="col-sm-8"> <input id="length" name="length" th:field="*{length}" class="form-control" type="text"> @@ -49,9 +43,33 @@ </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"> + <input id="minQtyUm" name="minQtyUm" th:field="*{minQtyUm}" 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="checkDigit" name="checkDigit" th:field="*{checkDigit}" 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="maxMaterials" name="maxMaterials" th:field="*{maxMaterials}" 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="maxLots" name="maxLots" th:field="*{maxLots}" 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="remark" name="remark" th:field="*{remark}" class="form-control" type="text"> + <input id="maxContainers" name="maxContainers" th:field="*{maxContainers}" class="form-control" type="text"> </div> </div> <!--<div class="form-group"> --> diff --git a/src/main/resources/templates/config/locationType/locationType.html b/src/main/resources/templates/config/locationType/locationType.html index 35ce1e1..f8fcd17 100644 --- a/src/main/resources/templates/config/locationType/locationType.html +++ b/src/main/resources/templates/config/locationType/locationType.html @@ -71,20 +71,12 @@ title : '库位类型Id' }, { - field : 'prefix', - title : '前缀' + field : 'code', + title : '货位类型' }, { - field : 'name', - title : '库位名称' - }, - { - field : 'code', - title : '编码' - }, - { - field : 'warehouseId', - title : '仓库Id' + field : 'name', + title : '名称' }, { field : 'warehouseCode', @@ -107,9 +99,25 @@ title : '最大重量kg' }, { - field : 'remark', - title : '描述' - }, + field : 'minQtyUm', + title : '最小允许单位' + }, + { + field : 'checkDigit', + title : '校验位' + }, + { + field : 'checkDigit', + title : '校验位' + }, + { + field : 'maxMaterials', + title : '最多混放物料数' + }, + { + field : 'maxContainers', + title : '最大允许托盘数' + }, { field : 'created', title : '创建时间' diff --git a/src/main/resources/templates/config/zoneCapacity/add.html b/src/main/resources/templates/config/zoneCapacity/add.html index 16d736e..d116575 100644 --- a/src/main/resources/templates/config/zoneCapacity/add.html +++ b/src/main/resources/templates/config/zoneCapacity/add.html @@ -12,12 +12,6 @@ <input id="materialId" name="materialId" type="hidden"> </div> </div> - <div class="form-group"> - <label class="col-sm-3 control-label">仓库:</label> - <div class="col-sm-8"> - <input id="warehouseCode" name="warehouseCode" class="form-control" type="text"> - </div> - </div> <div class="form-group"> <label class="col-sm-3 control-label">货位过滤条件:</label> <div class="col-sm-8"> -- libgit2 0.22.2