Commit bfbdec043d0ae807b67132caadfe4994006347ca

Authored by pengcheng
1 parent bb09b4d0

配置栏下的增删改查

src/main/java/com/huaheng/pc/config/containerType/domain/ContainerType.java
... ... @@ -53,7 +53,7 @@ public class ContainerType implements Serializable {
53 53 */
54 54 @TableField(value = "enable")
55 55 @ApiModelProperty(value="启用;0—禁用状态")
56   - private Integer enable;
  56 + private Boolean enable;
57 57  
58 58 /**
59 59 * 序号
... ... @@ -116,7 +116,7 @@ public class ContainerType implements Serializable {
116 116 */
117 117 @TableField(value = "useAsDEFAULT")
118 118 @ApiModelProperty(value="作为默认货箱")
119   - private Integer useAsDEFAULT;
  119 + private Boolean useAsDEFAULT;
120 120  
121 121 /**
122 122 * 状态
... ... @@ -373,23 +373,6 @@ public class ContainerType implements Serializable {
373 373 this.companyCode = companyCode;
374 374 }
375 375  
376   - /**
377   - * 获取启用;0—禁用状态
378   - *
379   - * @return enable - 启用;0—禁用状态
380   - */
381   - public Integer getEnable() {
382   - return enable;
383   - }
384   -
385   - /**
386   - * 设置启用;0—禁用状态
387   - *
388   - * @param enable 启用;0—禁用状态
389   - */
390   - public void setEnable(Integer enable) {
391   - this.enable = enable;
392   - }
393 376  
394 377 /**
395 378 * 获取序号
... ... @@ -517,39 +500,33 @@ public class ContainerType implements Serializable {
517 500 this.maxWeight = maxWeight;
518 501 }
519 502  
520   - /**
521   - * 获取装满度
522   - *
523   - * @return fillPercent - 装满度
524   - */
525 503 public Integer getFillPercent() {
526 504 return fillPercent;
527 505 }
528 506  
529   - /**
530   - * 设置装满度
531   - *
532   - * @param fillPercent 装满度
533   - */
534 507 public void setFillPercent(Integer fillPercent) {
535 508 this.fillPercent = fillPercent;
536 509 }
537 510  
538 511 /**
539   - * 获取作为默认货箱
  512 + * 获取装满度
540 513 *
541   - * @return useAsDEFAULT - 作为默认货箱
  514 + * @return fillPercent - 装满度
542 515 */
543   - public Integer getUseAsDEFAULT() {
  516 +
  517 + public Boolean getEnable() {
  518 + return enable;
  519 + }
  520 +
  521 + public void setEnable(Boolean enable) {
  522 + this.enable = enable;
  523 + }
  524 +
  525 + public Boolean getUseAsDEFAULT() {
544 526 return useAsDEFAULT;
545 527 }
546 528  
547   - /**
548   - * 设置作为默认货箱
549   - *
550   - * @param useAsDEFAULT 作为默认货箱
551   - */
552   - public void setUseAsDEFAULT(Integer useAsDEFAULT) {
  529 + public void setUseAsDEFAULT(Boolean useAsDEFAULT) {
553 530 this.useAsDEFAULT = useAsDEFAULT;
554 531 }
555 532  
... ...
src/main/java/com/huaheng/pc/config/locationType/controller/LocationTypeController.java
... ... @@ -16,6 +16,8 @@ import com.huaheng.framework.web.page.TableDataInfo;
16 16 import com.huaheng.framework.web.page.TableSupport;
17 17 import com.huaheng.pc.config.locationType.domain.LocationType;
18 18 import com.huaheng.pc.config.locationType.service.LocationTypeService;
  19 +import com.huaheng.pc.config.zone.domain.Zone;
  20 +import com.huaheng.pc.config.zone.service.ZoneService;
19 21 import org.apache.shiro.authz.annotation.RequiresPermissions;
20 22 import org.springframework.beans.factory.annotation.Autowired;
21 23 import org.springframework.stereotype.Controller;
... ... @@ -38,6 +40,8 @@ public class LocationTypeController extends BaseController
38 40  
39 41 @Autowired
40 42 private LocationTypeService locationTypeService;
  43 + @Autowired
  44 + private ZoneService zoneService;
41 45  
42 46 @RequiresPermissions("config:locationType:view")
43 47 @GetMapping()
... ... @@ -98,6 +102,18 @@ public class LocationTypeController extends BaseController
98 102 @ResponseBody
99 103 public AjaxResult addSave(LocationType locationType)
100 104 {
  105 + if(StringUtils.isEmpty(locationType.getCode())){
  106 + return AjaxResult.error("库位类型为空");
  107 + }
  108 + //查找location,是否存在
  109 + Zone zone=new Zone();
  110 + LambdaQueryWrapper<Zone> lambdaQueryWrapper = Wrappers.lambdaQuery();
  111 + lambdaQueryWrapper.eq(Zone::getLocationType,locationType.getCode())
  112 + .eq(Zone::getWarehouseCode,ShiroUtils.getWarehouseCode());
  113 + zone=zoneService.getOne(lambdaQueryWrapper);
  114 + if(zone==null){
  115 + return AjaxResult.error("系统没有此库位类型");
  116 + }
101 117 locationType.setWarehouseCode(ShiroUtils.getWarehouseCode());
102 118 locationType.setCreatedBy(ShiroUtils.getLoginName());
103 119 locationType.setLastUpdatedBy(ShiroUtils.getLoginName());
... ...
src/main/java/com/huaheng/pc/config/locationType/domain/LocationType.java
... ... @@ -93,7 +93,7 @@ public class LocationType implements Serializable {
93 93 * 有效
94 94 */
95 95 @TableField(value = "enable")
96   - private Integer enable;
  96 + private Boolean enable;
97 97  
98 98 /**
99 99 * 创建时间
... ...
src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeService.java
... ... @@ -7,6 +7,4 @@ import java.util.List;
7 7 import java.util.Map;
8 8  
9 9 public interface LocationTypeService extends IService<LocationType>{
10   -
11   - List<Map<String,Object>> getLocationPrefix();
12 10 }
... ...
src/main/java/com/huaheng/pc/config/locationType/service/LocationTypeServiceImpl.java
... ... @@ -14,13 +14,4 @@ import java.util.Map;
14 14 @Service("locationType")
15 15 public class LocationTypeServiceImpl extends ServiceImpl<LocationTypeMapper, LocationType> implements LocationTypeService{
16 16  
17   - @Override
18   - public List<Map<String, Object>> getLocationPrefix() {
19   - LocationType locationType=new LocationType();
20   - locationType.setWarehouseCode(ShiroUtils.getWarehouseCode());
21   - locationType.setEnable(0);
22   - LambdaQueryWrapper<LocationType> lambda = Wrappers.lambdaQuery(locationType);
23   -
24   - return this.listMaps(lambda);
25   - }
26 17 }
... ...
src/main/resources/templates/config/containerType/add.html
... ... @@ -17,6 +17,12 @@
17 17 <input id="name" name="name" class="form-control" type="text">
18 18 </div>
19 19 </div>
  20 + <div class="form-group">
  21 + <label class="col-sm-3 control-label">序号:</label>
  22 + <div class="col-sm-8">
  23 + <input id="sequence" name="sequence" class="form-control" type="text">
  24 + </div>
  25 + </div>
20 26 <!--<div class="form-group"> -->
21 27 <!--<label class="col-sm-3 control-label">仓库Id:</label>-->
22 28 <!--<div class="col-sm-8">-->
... ... @@ -30,12 +36,6 @@
30 36 <!--</div>-->
31 37 <!--</div>-->
32 38 <div class="form-group">
33   - <label class="col-sm-3 control-label">前缀:</label>
34   - <div class="col-sm-8">
35   - <input id="prefix" name="prefix" class="form-control" type="text">
36   - </div>
37   - </div>
38   - <div class="form-group">
39 39 <label class="col-sm-3 control-label">空箱重量kg:</label>
40 40 <div class="col-sm-8">
41 41 <input id="emptyWeight" name="emptyWeight" class="form-control" type="text">
... ... @@ -71,6 +71,12 @@
71 71 <input id="fillPercent" name="fillPercent" class="form-control" type="text">
72 72 </div>
73 73 </div>
  74 + <div class="form-group">
  75 + <label class="col-sm-3 control-label">状态:</label>
  76 + <div class="col-sm-8">
  77 + <input id="status" name="status" class="form-control" type="text">
  78 + </div>
  79 + </div>
74 80 <!--<div class="form-group"> -->
75 81 <!--<label class="col-sm-3 control-label">作为默认货箱:</label>-->
76 82 <!--<div class="col-sm-8">-->
... ... @@ -81,7 +87,7 @@
81 87 <label class="col-sm-3 control-label">是否默认容器:</label>
82 88 <div class="col-sm-8">
83 89 <div class="onoffswitch">
84   - <input type="checkbox" th:checked="false" class="onoffswitch-checkbox" id="useAsDefault" name="useAsDefault">
  90 + <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="useAsDefault" name="useAsDefault">
85 91 <label class="onoffswitch-label" for="useAsDefault">
86 92 <span class="onoffswitch-inner"></span>
87 93 <span class="onoffswitch-switch"></span>
... ... @@ -90,36 +96,6 @@
90 96 </div>
91 97 </div>
92 98 <div class="form-group">
93   - <label class="col-sm-3 control-label">类型描述:</label>
94   - <div class="col-sm-8">
95   - <input id="remark" name="remark" class="form-control" type="text">
96   - </div>
97   - </div>
98   - <!--<div class="form-group"> -->
99   - <!--<label class="col-sm-3 control-label">创建时间:</label>-->
100   - <!--<div class="col-sm-8">-->
101   - <!--<input id="created" name="created" class="form-control" type="text">-->
102   - <!--</div>-->
103   - <!--</div>-->
104   - <!--<div class="form-group"> -->
105   - <!--<label class="col-sm-3 control-label">创建用户:</label>-->
106   - <!--<div class="col-sm-8">-->
107   - <!--<input id="createdBy" name="createdBy" class="form-control" type="text">-->
108   - <!--</div>-->
109   - <!--</div>-->
110   - <!--<div class="form-group"> -->
111   - <!--<label class="col-sm-3 control-label">创建时间:</label>-->
112   - <!--<div class="col-sm-8">-->
113   - <!--<input id="lastUpdated" name="lastUpdated" class="form-control" type="text">-->
114   - <!--</div>-->
115   - <!--</div>-->
116   - <!--<div class="form-group"> -->
117   - <!--<label class="col-sm-3 control-label">更新用户:</label>-->
118   - <!--<div class="col-sm-8">-->
119   - <!--<input id="lastUpdatedBy" name="lastUpdatedBy" class="form-control" type="text">-->
120   - <!--</div>-->
121   - <!--</div>-->
122   - <div class="form-group">
123 99 <label class="col-sm-3 control-label">是否有效:</label>
124 100 <div class="col-sm-8">
125 101 <!--<input id="enable" name="enable" class="form-control" type="text">-->
... ... @@ -205,14 +181,14 @@
205 181 "useAsDefault" : $("input[name='useAsDefault']").is(':checked'),
206 182 "code" :$("input[name='code']").val(),
207 183 "name" :$("input[name='name']").val(),
208   - "prefix" :$("input[name='prefix']").val(),
  184 + "sequence" :$("input[name='sequence']").val(),
209 185 "emptyWeight" :$("input[name='emptyWeight']").val(),
210 186 "length" :$("input[name='length']").val(),
211 187 "width" :$("input[name='width']").val(),
212 188 "height" :$("input[name='height']").val(),
213 189 "maxWeight" :$("input[name='maxWeight']").val(),
214 190 "fillPercent" :$("input[name='fillPercent']").val(),
215   - "remark" :$("input[name='remark']").val()
  191 + "status" :$("input[name='status']").val(),
216 192 },
217 193 async : false,
218 194 error : function(request) {
... ...
src/main/resources/templates/config/containerType/containerType.html
... ... @@ -87,6 +87,10 @@
87 87 field : 'companyCode',
88 88 title : '货主编码'
89 89 },
  90 + {
  91 + field : 'sequence',
  92 + title : '序号'
  93 + },
90 94 {
91 95 field : 'emptyWeight',
92 96 title : '空箱重量kg'
... ... @@ -124,10 +128,6 @@
124 128 }
125 129 },
126 130 {
127   - field : 'remark',
128   - title : '类型描述'
129   - },
130   - {
131 131 field : 'created',
132 132 title : '创建时间'
133 133 },
... ...
src/main/resources/templates/config/containerType/edit.html
... ... @@ -30,12 +30,7 @@
30 30 <!--<input id="warehouseCode" name="warehouseCode" th:field="*{warehouseCode}" class="form-control" type="text">-->
31 31 <!--</div>-->
32 32 <!--</div>-->
33   - <div class="form-group">
34   - <label class="col-sm-3 control-label">前缀:</label>
35   - <div class="col-sm-8">
36   - <input id="prefix" name="prefix" th:field="*{prefix}" class="form-control" type="text">
37   - </div>
38   - </div>
  33 +
39 34 <div class="form-group">
40 35 <label class="col-sm-3 control-label">空箱重量kg:</label>
41 36 <div class="col-sm-8">
... ... @@ -78,24 +73,24 @@
78 73 <input id="useAsDefault" name="useAsDefault" th:field="*{ }" class="form-control" type="text">
79 74 </div>
80 75 </div>-->
81   - <div class="form-group">
82   - <label class="col-sm-3 control-label">是否默认容器:</label>
83   - <div class="col-sm-8">
84   - <div class="onoffswitch">
85   - <input type="checkbox" th:checked="${containerType.useAsDefault}" class="onoffswitch-checkbox" id="useAsDefault" name="useAsDefault">
86   - <label class="onoffswitch-label" for="useAsDefault">
87   - <span class="onoffswitch-inner"></span>
88   - <span class="onoffswitch-switch"></span>
89   - </label>
90   - </div>
91   - </div>
92   - </div>
93   - <div class="form-group">
94   - <label class="col-sm-3 control-label">类型描述:</label>
95   - <div class="col-sm-8">
96   - <input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">
97   - </div>
98   - </div>
  76 + <!--<div class="form-group">-->
  77 + <!--<label class="col-sm-3 control-label">是否默认容器:</label>-->
  78 + <!--<div class="col-sm-8">-->
  79 + <!--<div class="onoffswitch">-->
  80 + <!--<input type="checkbox" th:checked="${containerType.useAsDefault}" class="onoffswitch-checkbox" id="useAsDefault" name="useAsDefault">-->
  81 + <!--<label class="onoffswitch-label" for="useAsDefault">-->
  82 + <!--<span class="onoffswitch-inner"></span>-->
  83 + <!--<span class="onoffswitch-switch"></span>-->
  84 + <!--</label>-->
  85 + <!--</div>-->
  86 + <!--</div>-->
  87 + <!--</div>-->
  88 + <!--<div class="form-group"> -->
  89 + <!--<label class="col-sm-3 control-label">类型描述:</label>-->
  90 + <!--<div class="col-sm-8">-->
  91 + <!--<input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">-->
  92 + <!--</div>-->
  93 + <!--</div>-->
99 94 <!--<div class="form-group"> -->
100 95 <!--<label class="col-sm-3 control-label">创建时间:</label>-->
101 96 <!--<div class="col-sm-8">-->
... ...
src/main/resources/templates/config/locationType/add.html
... ... @@ -17,12 +17,6 @@
17 17 <input id="name" name="name" class="form-control" type="text">
18 18 </div>
19 19 </div>
20   - <div class="form-group">
21   - <label class="col-sm-3 control-label">前缀:</label>
22   - <div class="col-sm-8">
23   - <input id="prefix" name="prefix" class="form-control" type="text">
24   - </div>
25   - </div>
26 20 <!--<div class="form-group"> -->
27 21 <!--<label class="col-sm-3 control-label">仓库Id:</label>-->
28 22 <!--<div class="col-sm-8">-->
... ... @@ -60,9 +54,33 @@
60 54 </div>
61 55 </div>
62 56 <div class="form-group">
63   - <label class="col-sm-3 control-label">描述:</label>
  57 + <label class="col-sm-3 control-label">最小允许单位:</label>
  58 + <div class="col-sm-8">
  59 + <input id="minQtyUm" name="minQtyUm" class="form-control" type="text">
  60 + </div>
  61 + </div>
  62 + <div class="form-group">
  63 + <label class="col-sm-3 control-label">校验位:</label>
  64 + <div class="col-sm-8">
  65 + <input id="checkDigit" name="checkDigit" class="form-control" type="text">
  66 + </div>
  67 + </div>
  68 + <div class="form-group">
  69 + <label class="col-sm-3 control-label">最多混放物料数:</label>
  70 + <div class="col-sm-8">
  71 + <input id="maxMaterials" name="maxMaterials" class="form-control" type="text">
  72 + </div>
  73 + </div>
  74 + <div class="form-group">
  75 + <label class="col-sm-3 control-label">最大批号数量:</label>
64 76 <div class="col-sm-8">
65   - <input id="remark" name="remark" class="form-control" type="text">
  77 + <input id="maxLots" name="maxLots" class="form-control" type="text">
  78 + </div>
  79 + </div>
  80 + <div class="form-group">
  81 + <label class="col-sm-3 control-label">最大允许托盘数:</label>
  82 + <div class="col-sm-8">
  83 + <input id="maxContainers" name="maxContainers" class="form-control" type="text">
66 84 </div>
67 85 </div>
68 86 <!--<div class="form-group"> -->
... ... @@ -89,19 +107,19 @@
89 107 <!--<input id="lastUpdatedBy" name="lastUpdatedBy" class="form-control" type="text">-->
90 108 <!--</div>-->
91 109 <!--</div>-->
92   - <div class="form-group">
93   - <label class="col-sm-3 control-label">是否有效:</label>
94   - <div class="col-sm-8">
95   - <!--<input id="enable" name="enable" class="form-control" type="text">-->
96   - <div class="onoffswitch">
97   - <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable">
98   - <label class="onoffswitch-label" for="enable">
99   - <span class="onoffswitch-inner"></span>
100   - <span class="onoffswitch-switch"></span>
101   - </label>
102   - </div>
103   - </div>
104   - </div>
  110 + <!--<div class="form-group"> -->
  111 + <!--<label class="col-sm-3 control-label">是否有效:</label>-->
  112 + <!--<div class="col-sm-8">-->
  113 + <!--&lt;!&ndash;<input id="enable" name="enable" class="form-control" type="text">&ndash;&gt;-->
  114 + <!--<div class="onoffswitch">-->
  115 + <!--<input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable">-->
  116 + <!--<label class="onoffswitch-label" for="enable">-->
  117 + <!--<span class="onoffswitch-inner"></span>-->
  118 + <!--<span class="onoffswitch-switch"></span>-->
  119 + <!--</label>-->
  120 + <!--</div>-->
  121 + <!--</div>-->
  122 + <!--</div>-->
105 123 <!--<div class="form-group"> -->
106 124 <!--<label class="col-sm-3 control-label">是否删除:</label>-->
107 125 <!--<div class="col-sm-8">-->
... ...
src/main/resources/templates/config/locationType/edit.html
... ... @@ -19,12 +19,6 @@
19 19 </div>
20 20 </div>
21 21 <div class="form-group">
22   - <label class="col-sm-3 control-label">前缀:</label>
23   - <div class="col-sm-8">
24   - <input id="prefix" name="prefix" th:field="*{prefix}" class="form-control" type="text">
25   - </div>
26   - </div>
27   - <div class="form-group">
28 22 <label class="col-sm-3 control-label">长m:</label>
29 23 <div class="col-sm-8">
30 24 <input id="length" name="length" th:field="*{length}" class="form-control" type="text">
... ... @@ -49,9 +43,33 @@
49 43 </div>
50 44 </div>
51 45 <div class="form-group">
52   - <label class="col-sm-3 control-label">描述:</label>
  46 + <label class="col-sm-3 control-label">最小允许单位:</label>
  47 + <div class="col-sm-8">
  48 + <input id="minQtyUm" name="minQtyUm" th:field="*{minQtyUm}" class="form-control" type="text">
  49 + </div>
  50 + </div>
  51 + <div class="form-group">
  52 + <label class="col-sm-3 control-label">校验位:</label>
  53 + <div class="col-sm-8">
  54 + <input id="checkDigit" name="checkDigit" th:field="*{checkDigit}" class="form-control" type="text">
  55 + </div>
  56 + </div>
  57 + <div class="form-group">
  58 + <label class="col-sm-3 control-label">最多混放物料数:</label>
  59 + <div class="col-sm-8">
  60 + <input id="maxMaterials" name="maxMaterials" th:field="*{maxMaterials}" class="form-control" type="text">
  61 + </div>
  62 + </div>
  63 + <div class="form-group">
  64 + <label class="col-sm-3 control-label">最大批号数量:</label>
  65 + <div class="col-sm-8">
  66 + <input id="maxLots" name="maxLots" th:field="*{maxLots}" class="form-control" type="text">
  67 + </div>
  68 + </div>
  69 + <div class="form-group">
  70 + <label class="col-sm-3 control-label">最大允许托盘数:</label>
53 71 <div class="col-sm-8">
54   - <input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">
  72 + <input id="maxContainers" name="maxContainers" th:field="*{maxContainers}" class="form-control" type="text">
55 73 </div>
56 74 </div>
57 75 <!--<div class="form-group"> -->
... ...
src/main/resources/templates/config/locationType/locationType.html
... ... @@ -71,20 +71,12 @@
71 71 title : '库位类型Id'
72 72 },
73 73 {
74   - field : 'prefix',
75   - title : '前缀'
  74 + field : 'code',
  75 + title : '货位类型'
76 76 },
77 77 {
78   - field : 'name',
79   - title : '库位名称'
80   - },
81   - {
82   - field : 'code',
83   - title : '编码'
84   - },
85   - {
86   - field : 'warehouseId',
87   - title : '仓库Id'
  78 + field : 'name',
  79 + title : '名称'
88 80 },
89 81 {
90 82 field : 'warehouseCode',
... ... @@ -107,9 +99,25 @@
107 99 title : '最大重量kg'
108 100 },
109 101 {
110   - field : 'remark',
111   - title : '描述'
112   - },
  102 + field : 'minQtyUm',
  103 + title : '最小允许单位'
  104 + },
  105 + {
  106 + field : 'checkDigit',
  107 + title : '校验位'
  108 + },
  109 + {
  110 + field : 'checkDigit',
  111 + title : '校验位'
  112 + },
  113 + {
  114 + field : 'maxMaterials',
  115 + title : '最多混放物料数'
  116 + },
  117 + {
  118 + field : 'maxContainers',
  119 + title : '最大允许托盘数'
  120 + },
113 121 {
114 122 field : 'created',
115 123 title : '创建时间'
... ...
src/main/resources/templates/config/zoneCapacity/add.html
... ... @@ -12,12 +12,6 @@
12 12 <input id="materialId" name="materialId" type="hidden">
13 13 </div>
14 14 </div>
15   - <div class="form-group">
16   - <label class="col-sm-3 control-label">仓库:</label>
17   - <div class="col-sm-8">
18   - <input id="warehouseCode" name="warehouseCode" class="form-control" type="text">
19   - </div>
20   - </div>
21 15 <div class="form-group">
22 16 <label class="col-sm-3 control-label">货位过滤条件:</label>
23 17 <div class="col-sm-8">
... ...