Commit 14ea7786136911465cc808d7a28121a4a028c181

Authored by xqs
2 parents dd3c9c5d 2bfd947d

Merge branch 'develop' of http://172.16.29.40:8010/wms/wms2 into develop

src/main/java/com/huaheng/pc/config/location/service/LocationServiceImpl.java
@@ -63,6 +63,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i @@ -63,6 +63,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i
63 } 63 }
64 64
65 //插入数据库 65 //插入数据库
  66 + location.setCode(code);
66 location.setWarehouseCode(ShiroUtils.getWarehouseCode()); 67 location.setWarehouseCode(ShiroUtils.getWarehouseCode());
67 location.setCreatedBy(ShiroUtils.getLoginName()); 68 location.setCreatedBy(ShiroUtils.getLoginName());
68 Boolean flag=this.save(location); 69 Boolean flag=this.save(location);
@@ -124,7 +125,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i @@ -124,7 +125,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i
124 queryWrapper.eq(Location::getCode,code) 125 queryWrapper.eq(Location::getCode,code)
125 .eq(Location::getWarehouseCode,ShiroUtils.getWarehouseCode()); 126 .eq(Location::getWarehouseCode,ShiroUtils.getWarehouseCode());
126 List<Location> locationList = locationService.list(queryWrapper); 127 List<Location> locationList = locationService.list(queryWrapper);
127 - if (locationList.size() != 0) { 128 + if (locationList.size() == 0) {
128 param.setCode(code); 129 param.setCode(code);
129 locations.add(param); 130 locations.add(param);
130 } 131 }
src/main/resources/templates/config/location/add.html
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 <label class="col-sm-3 control-label">库位类型:</label> 33 <label class="col-sm-3 control-label">库位类型:</label>
34 <div class="col-sm-8"> 34 <div class="col-sm-8">
35 <select id="locationType" name="locationType" class="form-control" th:with="locationType=${@locationType.getLocationPrefix()}"> 35 <select id="locationType" name="locationType" class="form-control" th:with="locationType=${@locationType.getLocationPrefix()}">
36 - <option th:each="item : ${locationType}" th:text="${item['name']}" th:value="${item['prefix']}"></option> 36 + <option th:each="item : ${locationType}" th:text="${item['name']}" th:value="${item['code']}"></option>
37 </select> 37 </select>
38 </div> 38 </div>
39 </div> 39 </div>
@@ -48,8 +48,8 @@ @@ -48,8 +48,8 @@
48 <div class="form-group"> 48 <div class="form-group">
49 <label class="col-sm-3 control-label">库位状态:</label> 49 <label class="col-sm-3 control-label">库位状态:</label>
50 <div class="col-sm-8"> 50 <div class="col-sm-8">
51 - <select id="status" name="status" class="form-control" th:with="statusList=${@dict.getType('locationStatus')}">  
52 - <option th:each="item : ${statusList}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option> 51 + <select id="status" name="status" class="form-control" th:with="status=${@dict.getType('locationStatus')}">
  52 + <option th:each="item : ${status}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option>
53 </select> 53 </select>
54 </div> 54 </div>
55 </div> 55 </div>
@@ -66,30 +66,22 @@ @@ -66,30 +66,22 @@
66 var prefix = ctx + "config/location" 66 var prefix = ctx + "config/location"
67 $("#form-location-add").validate({ 67 $("#form-location-add").validate({
68 rules:{ 68 rules:{
69 - row:{ 69 + iRow:{
70 required:true, 70 required:true,
71 digits:true 71 digits:true
72 }, 72 },
73 - line:{ 73 + iColumn:{
74 required:true, 74 required:true,
75 digits:true 75 digits:true
76 }, 76 },
77 - layer:{ 77 + iLayer:{
78 required:true, 78 required:true,
79 digits:true 79 digits:true
80 }, 80 },
81 - grid:{ 81 + iGrid:{
82 required:true, 82 required:true,
83 digits:true 83 digits:true
84 - },  
85 - rowIndex:{  
86 - required:true,  
87 - range:[1,4]  
88 - },  
89 - roadway:{  
90 - required:true,  
91 - min:0  
92 - }, 84 + }
93 }, 85 },
94 submitHandler: function(form) { 86 submitHandler: function(form) {
95 $.ajax({ 87 $.ajax({
@@ -101,9 +93,9 @@ @@ -101,9 +93,9 @@
101 "iColumn": $("input[name='iColumn']").val(), 93 "iColumn": $("input[name='iColumn']").val(),
102 "iLayer": $("input[name='iLayer']").val(), 94 "iLayer": $("input[name='iLayer']").val(),
103 "iGrid": $("input[name='iGrid']").val(), 95 "iGrid": $("input[name='iGrid']").val(),
104 - "locationType": $("#type option:selected").val(), 96 + "locationType": $("#locationType option:selected").val(),
105 "zoneCode": $("#zoneCode option:selected").attr("code"), 97 "zoneCode": $("#zoneCode option:selected").attr("code"),
106 - "enable" : $("input[name='enable']").is(':checked'), 98 + "status" : $("#status option:selected").val(),
107 }, 99 },
108 async : false, 100 async : false,
109 error : function(request) { 101 error : function(request) {
src/main/resources/templates/config/location/addBatch.html
@@ -29,12 +29,12 @@ @@ -29,12 +29,12 @@
29 <input id="iGrid" name="iGrid" class="form-control" type="text"> 29 <input id="iGrid" name="iGrid" class="form-control" type="text">
30 </div> 30 </div>
31 </div> 31 </div>
32 - <div class="form-group"> 32 + <div class="form-group">
33 <label class="col-sm-3 control-label">库位类型:</label> 33 <label class="col-sm-3 control-label">库位类型:</label>
34 <div class="col-sm-8"> 34 <div class="col-sm-8">
35 - <select id="locationType" class="form-control" th:with="locationType=${@locationType.getLocationPrefix()}">  
36 - <option th:each="item : ${locationType}" th:text="${item['name']}" th:value="${item['code']}"></option>  
37 - </select> 35 + <select id="locationType" name="locationType" class="form-control" th:with="locationType=${@locationType.getLocationPrefix()}">
  36 + <option th:each="item : ${locationType}" th:text="${item['name']}" th:value="${item['code']}"></option>
  37 + </select>
38 </div> 38 </div>
39 </div> 39 </div>
40 <div class="form-group"> 40 <div class="form-group">
@@ -48,8 +48,8 @@ @@ -48,8 +48,8 @@
48 <div class="form-group"> 48 <div class="form-group">
49 <label class="col-sm-3 control-label">库位状态:</label> 49 <label class="col-sm-3 control-label">库位状态:</label>
50 <div class="col-sm-8"> 50 <div class="col-sm-8">
51 - <select id="status" name="status" class="form-control" th:with="statusList=${@dict.getType('locationStatus')}">  
52 - <option th:each="item : ${statusList}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option> 51 + <select id="status" name="status" class="form-control" th:with="status=${@dict.getType('locationStatus')}">
  52 + <option th:each="item : ${status}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option>
53 </select> 53 </select>
54 </div> 54 </div>
55 </div> 55 </div>
@@ -87,13 +87,12 @@ @@ -87,13 +87,12 @@
87 digits:true 87 digits:true
88 }, 88 },
89 locationType:{ 89 locationType:{
90 - required:true,  
91 - digits:true 90 + required:true
92 }, 91 },
93 - status:{  
94 - required:true,  
95 - digits:true  
96 - } 92 + // status:{
  93 + // required:true,
  94 + // digits:true
  95 + // }
97 }, 96 },
98 submitHandler: function(form) { 97 submitHandler: function(form) {
99 $.ajax({ 98 $.ajax({
@@ -107,7 +106,7 @@ @@ -107,7 +106,7 @@
107 "iGrid": $("input[name='iGrid']").val(), 106 "iGrid": $("input[name='iGrid']").val(),
108 "locationType": $("#locationType option:selected").val(), 107 "locationType": $("#locationType option:selected").val(),
109 "zoneCode": $("#zone option:selected").attr("code"), 108 "zoneCode": $("#zone option:selected").attr("code"),
110 - "status" : $("input[name='status']").is(':checked'), 109 + "status" : $("#status option:selected").val(),
111 }, 110 },
112 async : false, 111 async : false,
113 error : function(request) { 112 error : function(request) {