Commit 1b93d115fa7e7e9223111cf66c87d7b9bfca96b2

Authored by 游杰
1 parent 6d2f82d4

库位监控 增加库位统计

src/main/java/com/huaheng/pc/config/zone/controller/ZoneController.java
... ... @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 4 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
6 6 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  7 +import com.huaheng.common.constant.QuantityConstant;
7 8 import com.huaheng.common.support.Convert;
8 9 import com.huaheng.common.utils.StringUtils;
9 10 import com.huaheng.common.utils.security.ShiroUtils;
... ... @@ -15,6 +16,7 @@ import com.huaheng.framework.web.page.PageDomain;
15 16 import com.huaheng.framework.web.page.TableDataInfo;
16 17 import com.huaheng.framework.web.page.TableSupport;
17 18 import com.huaheng.pc.config.container.domain.Container;
  19 +import com.huaheng.pc.config.container.service.ContainerService;
18 20 import com.huaheng.pc.config.location.domain.Location;
19 21 import com.huaheng.pc.config.location.service.LocationService;
20 22 import com.huaheng.pc.config.station.domain.Station;
... ... @@ -31,6 +33,7 @@ import java.util.ArrayList;
31 33 import java.util.HashMap;
32 34 import java.util.List;
33 35 import java.util.Map;
  36 +import java.util.stream.Collectors;
34 37  
35 38 /**
36 39 * 库区 信息操作处理
... ... @@ -49,6 +52,8 @@ public class ZoneController extends BaseController {
49 52 private ZoneService zoneService;
50 53 @Resource
51 54 private LocationService locationService;
  55 + @Resource
  56 + private ContainerService containerService;
52 57  
53 58 @RequiresPermissions("config:zone:view")
54 59 @GetMapping()
... ... @@ -180,28 +185,38 @@ public class ZoneController extends BaseController {
180 185  
181 186 @GetMapping("/getStatus")
182 187 @ResponseBody
183   - public AjaxResult getStatus(String zoneCode){
  188 + public AjaxResult getStatus(String zoneCode) {
184 189 HashMap<String, Integer> map = new HashMap<>();
185 190 LambdaQueryWrapper<Location> queryWrapper = Wrappers.lambdaQuery();
186 191 queryWrapper.eq(Location::getZoneCode,zoneCode);
187 192 List<Location> locationList = locationService.list(queryWrapper);
188   - map.put("location",locationList.size());
  193 + map.put("location", locationList.size());
189 194 queryWrapper = Wrappers.lambdaQuery();
190 195 queryWrapper.and(wrapper->wrapper.isNull(Location::getContainerCode).or().eq(Location::getContainerCode,""))
191 196 .eq(Location::getZoneCode,zoneCode);
192 197 List<Location> emptyLocationList = locationService.list(queryWrapper);
193   - map.put("emptyLocation",emptyLocationList.size());
194   - queryWrapper = Wrappers.lambdaQuery();
195   - queryWrapper.eq(Location::getZoneCode,zoneCode)
196   - .eq(Location::getStatus,"empty")
197   - .isNotNull(Location::getContainerCode)
198   - .ne(Location::getContainerCode,"");
199   - List<Location> haveContainLocation = locationService.list(queryWrapper);
200   - map.put("haveContainLocation",haveContainLocation.size());
201   - queryWrapper = Wrappers.lambdaQuery();
202   - queryWrapper.eq(Location::getZoneCode,zoneCode)
203   - .eq(Location::getStatus,"some");
204   - map.put("haveInventoryLocation",locationService.list(queryWrapper).size());
  198 + map.put("emptyLocation", emptyLocationList.size());
  199 +
  200 + LambdaQueryWrapper<Container> containerLambdaQueryWrapper2 = Wrappers.lambdaQuery();
  201 + containerLambdaQueryWrapper2.eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_EMPTY);
  202 + List<Container> containerList2 = containerService.list(containerLambdaQueryWrapper2);
  203 + List<String> containerCodeList2 = containerList2.stream().map(Container::getCode).collect(Collectors.toList());
  204 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper2 = Wrappers.lambdaQuery();
  205 + locationLambdaQueryWrapper2.in(Location::getContainerCode, containerCodeList2);
  206 + locationLambdaQueryWrapper2.eq(Location::getZoneCode, zoneCode);
  207 + List<Location> haveEmptyContainLocation = locationService.list(locationLambdaQueryWrapper2);
  208 + map.put("haveContainLocation", haveEmptyContainLocation.size());
  209 +
  210 + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery();
  211 + containerLambdaQueryWrapper.eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_SOME);
  212 + List<Container> containerList = containerService.list(containerLambdaQueryWrapper);
  213 + List<String> containerCodeList = containerList.stream().map(Container::getCode).collect(Collectors.toList());
  214 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  215 + locationLambdaQueryWrapper.in(Location::getContainerCode, containerCodeList);
  216 + locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode);
  217 + List<Location> haveInventoryLocation = locationService.list(locationLambdaQueryWrapper);
  218 + map.put("haveInventoryLocation", haveInventoryLocation.size());
  219 +
205 220 return AjaxResult.success().setData(map);
206 221 }
207 222 }
... ...
src/main/resources/templates/monitor/locationstatus/locationstatus.html
... ... @@ -67,9 +67,9 @@
67 67 <option value="layer">层</option>
68 68 </select>
69 69 </li>
70   - <li>货主编码:
71   - <input type="text" name="receiptCompanyCode" id="receiptCompanyCode">
72   - </li>
  70 +<!-- <li>货主编码:-->
  71 +<!-- <input type="text" name="receiptCompanyCode" id="receiptCompanyCode">-->
  72 +<!-- </li>-->
73 73 <li>
74 74 <a class="btn btn-primary btn-rounded btn-sm" onclick="Search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
75 75 </li>
... ... @@ -117,21 +117,22 @@
117 117 <li>
118 118 整盘禁用:<img src="../img/icon/整盘禁用.png">
119 119 </li>
  120 + <li><span style="font-size: 12px">库位统计情况:</span>
  121 + <input style="width: 400px; font-size: 12px" type="text" id="zone" disabled/>
  122 + </li>
120 123 </ul><br><br>
121 124 <ul id="info_list">
122   - <li><span>库区:</span><input type="text" id="zone" style="width: 450px" disabled/></li>
123 125 <li><span>库位:</span><input type="text" id="code" disabled/></li>
124 126 <li><span>容器编码:</span><input type="text" id="containerCode" disabled/></li>
125 127 <li><span>物料信息:<select id="material" style="width: auto"><option>无</option></select></span></li>
126   - <li>&nbsp;&nbsp;&nbsp;&nbsp;</li>
127 128 <li>
128 129 <a class="btn btn-success btn-rounded btn-sm" onclick="checkLocationCode()" shiro:hasPermission="inventory:inventory:seeOut"><i class="fa fa-eye"></i>&nbsp;出库查看</a>
129 130 </li>
130 131 </ul>
131   - <ul>
132   - <li style="float:left;margin-left: 40px"><button type="button" class="btn btn-sm btn-success" onclick="searchLocation()">查看库位</button></li>
133   - <li style="float:left;margin-left: 20px"><button type="button" class="btn btn-sm btn-success" onclick="searchInventory()">查看库存</button></li>
134   - </ul>
  132 +<!-- <ul>-->
  133 +<!-- <li style="float:left;margin-left: 40px"><button type="button" class="btn btn-sm btn-success" onclick="searchLocation()">查看库位</button></li>-->
  134 +<!-- <li style="float:left;margin-left: 20px"><button type="button" class="btn btn-sm btn-success" onclick="searchInventory()">查看库存</button></li>-->
  135 +<!-- </ul>-->
135 136 </div>
136 137 </form>
137 138 </div>
... ... @@ -625,8 +626,8 @@
625 626 },
626 627 success:function (response) {
627 628 if (response.code==200){
628   - $("#zone").val("库位数量:"+response.data.location+", 空柜数量:"+response.data.emptyLocation+
629   - ", 空盘数量:"+response.data.haveContainLocation+", 半整盘库位数量:"+response.data.haveInventoryLocation)
  629 + $("#zone").val("库位总数:"+response.data.location+", 空闲库位:"+response.data.emptyLocation+
  630 + ", 空托盘库位:"+response.data.haveContainLocation+", 有货库位:"+response.data.haveInventoryLocation)
630 631 }else {
631 632 $.modal.alertError(response.msg)
632 633 }
... ...
src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html
... ... @@ -333,7 +333,7 @@
333 333 {
334 334 field: 'projectCode',
335 335 title: '项目号',
336   - sortable:true
  336 + visible: false
337 337 },
338 338 {
339 339 field: 'shipmentType',
... ... @@ -379,7 +379,8 @@
379 379 },
380 380 {
381 381 field: 'waveId',
382   - title: '波次号'
  382 + title: '波次号',
  383 + visible: false
383 384 },
384 385 {
385 386 field: 'totalQty',
... ...