Commit df7b45186c399ca529ea24202d13722cf8f8f025
1 parent
b8f8c22c
增加查库内空托盘接口listEmptyContainerInLocation
Showing
5 changed files
with
73 additions
and
31 deletions
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java
1 | 1 | package org.jeecg.modules.wms.config.location.controller; |
2 | 2 | |
3 | -import java.util.Arrays; | |
4 | -import java.util.List; | |
5 | -import java.util.Map; | |
6 | -import java.util.stream.Collectors; | |
7 | -import java.io.IOException; | |
8 | -import java.io.UnsupportedEncodingException; | |
9 | -import java.net.URLDecoder; | |
10 | -import javax.servlet.http.HttpServletRequest; | |
11 | -import javax.servlet.http.HttpServletResponse; | |
12 | - | |
13 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
14 | -import org.apache.shiro.authz.annotation.RequiresPermissions; | |
15 | -import org.jeecg.common.api.vo.Result; | |
16 | -import org.jeecg.common.system.query.QueryGenerator; | |
17 | -import org.jeecg.common.system.util.JwtUtil; | |
18 | -import org.jeecg.common.util.oConvertUtils; | |
19 | - | |
20 | 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
21 | 5 | import com.baomidou.mybatisplus.core.metadata.IPage; |
22 | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
7 | +import io.swagger.annotations.Api; | |
8 | +import io.swagger.annotations.ApiOperation; | |
23 | 9 | import lombok.extern.slf4j.Slf4j; |
24 | - | |
25 | -import org.jeecg.modules.wms.config.container.entity.Container; | |
10 | +import org.apache.shiro.authz.annotation.RequiresPermissions; | |
11 | +import org.jeecg.common.api.vo.Result; | |
12 | +import org.jeecg.common.aspect.annotation.AutoLog; | |
13 | +import org.jeecg.common.system.base.controller.JeecgController; | |
14 | +import org.jeecg.common.system.query.QueryGenerator; | |
15 | +import org.jeecg.common.system.util.JwtUtil; | |
26 | 16 | import org.jeecg.modules.wms.config.location.entity.BatchLocation; |
27 | 17 | import org.jeecg.modules.wms.config.location.entity.Location; |
28 | 18 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
29 | 19 | import org.jeecg.utils.StringUtils; |
30 | 20 | import org.jeecg.utils.constant.QuantityConstant; |
31 | -import org.jeecgframework.poi.excel.ExcelImportUtil; | |
32 | -import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |
33 | -import org.jeecgframework.poi.excel.entity.ExportParams; | |
34 | -import org.jeecgframework.poi.excel.entity.ImportParams; | |
35 | -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |
36 | -import org.jeecg.common.system.base.controller.JeecgController; | |
37 | 21 | import org.springframework.beans.factory.annotation.Autowired; |
38 | 22 | import org.springframework.web.bind.annotation.*; |
39 | -import org.springframework.web.multipart.MultipartFile; | |
40 | -import org.springframework.web.multipart.MultipartHttpServletRequest; | |
41 | 23 | import org.springframework.web.servlet.ModelAndView; |
42 | -import com.alibaba.fastjson.JSON; | |
43 | -import io.swagger.annotations.Api; | |
44 | -import io.swagger.annotations.ApiOperation; | |
45 | -import org.jeecg.common.aspect.annotation.AutoLog; | |
24 | + | |
25 | +import javax.servlet.http.HttpServletRequest; | |
26 | +import javax.servlet.http.HttpServletResponse; | |
27 | +import java.util.Arrays; | |
28 | +import java.util.List; | |
46 | 29 | |
47 | 30 | /** |
48 | 31 | * @Description: 库位管理 |
... | ... | @@ -84,6 +67,19 @@ public class LocationController extends JeecgController<Location, ILocationServi |
84 | 67 | return Result.OK(pageList); |
85 | 68 | } |
86 | 69 | |
70 | + @ApiOperation(value="库位管理-分页查询放空托的库位", notes="分页查询放空托的库位") | |
71 | + @GetMapping(value = "/listEmptyContainerInLocation") | |
72 | + public Result<IPage<Location>> listEmptyContainerInLocation(Location location, | |
73 | + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |
74 | + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |
75 | + HttpServletRequest req) { | |
76 | + Page<Location> page = new Page<Location>(pageNo, pageSize); | |
77 | + String warehouseCode = JwtUtil.getWarehouseCodeByToken(req); | |
78 | + location.setWarehouseCode(warehouseCode); | |
79 | + IPage<Location> pageList = locationService.listEmptyContainerInLocation(page, location); | |
80 | + return Result.OK(pageList); | |
81 | + } | |
82 | + | |
87 | 83 | /** |
88 | 84 | * 添加 |
89 | 85 | * |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/mapper/LocationMapper.java
... | ... | @@ -2,6 +2,7 @@ package org.jeecg.modules.wms.config.location.mapper; |
2 | 2 | |
3 | 3 | import java.util.List; |
4 | 4 | |
5 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
5 | 6 | import org.apache.ibatis.annotations.Param; |
6 | 7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
7 | 8 | import org.jeecg.modules.wms.config.location.entity.Location; |
... | ... | @@ -9,7 +10,7 @@ import org.jeecg.modules.wms.config.location.entity.Location; |
9 | 10 | /** |
10 | 11 | * @Description: 库位管理 |
11 | 12 | * @Author: jeecg-boot |
12 | - * @Date: 2022-10-27 | |
13 | + * @Date: 2022-10-27 | |
13 | 14 | * @Version: V1.0 |
14 | 15 | */ |
15 | 16 | public interface LocationMapper extends BaseMapper<Location> { |
... | ... | @@ -19,4 +20,5 @@ public interface LocationMapper extends BaseMapper<Location> { |
19 | 20 | |
20 | 21 | int getFirstRowOfZone(@Param("warehouseCode") String warehouseCode, @Param("locationType") String locationType); |
21 | 22 | |
23 | + IPage<Location> listEmptyContainerInLocation(IPage<?> page, @Param("location") Location location); | |
22 | 24 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/mapper/xml/LocationMapper.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="org.jeecg.modules.wms.config.location.mapper.LocationMapper"> | |
4 | + | |
5 | + <select id="getAllLocation" resultType="org.jeecg.modules.wms.config.location.entity.Location"></select> | |
6 | + <select id="getFirstRowOfZone" resultType="java.lang.Integer"></select> | |
7 | + <select id="listEmptyContainerInLocation" parameterType="org.jeecg.modules.wms.config.location.entity.Location" | |
8 | + resultType="org.jeecg.modules.wms.config.location.entity.Location"> | |
9 | + SELECT * | |
10 | + FROM location t | |
11 | + <where> | |
12 | + AND t.warehouse_code = #{location.warehouseCode} | |
13 | + AND t.status='empty' | |
14 | + AND t.container_code !='' | |
15 | + AND t.container_code is not NULL | |
16 | + AND t.container_code NOT in (SELECT h.container_code from task_header h WHERE status < 100 AND warehouse_code=#{location.warehouseCode}) | |
17 | + and t.`code` in(select cc.location_code from container cc where cc.`status`='empty' and cc.warehouse_code =#{location.warehouseCode}) | |
18 | + <if test="location.zoneCode != null and location.zoneCode !=''"> | |
19 | + and t.zone_code = #{location.zoneCode} | |
20 | + </if> | |
21 | + <if test="location.containerCode != null and location.containerCode !=''"> | |
22 | + and t.container_code = #{location.containerCode} | |
23 | + </if> | |
24 | + <if test="location.code != null and location.code !=''"> | |
25 | + and t.`code` = #{location.code} | |
26 | + </if> | |
27 | + <if test="location.roadWay != null and location.roadWay !=''"> | |
28 | + and t.`road_way` = #{location.roadWay} | |
29 | + </if> | |
30 | + </where> | |
31 | + </select> | |
32 | +</mapper> | |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java
1 | 1 | package org.jeecg.modules.wms.config.location.service; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
4 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
3 | 5 | import com.baomidou.mybatisplus.extension.service.IService; |
4 | 6 | import org.jeecg.common.api.vo.Result; |
5 | 7 | import org.jeecg.modules.wms.config.location.entity.BatchLocation; |
... | ... | @@ -42,4 +44,6 @@ public interface ILocationService extends IService<Location> { |
42 | 44 | Result batchAdd(BatchLocation batchLocation); |
43 | 45 | |
44 | 46 | LocationInfo getAllLocation(String type); |
47 | + | |
48 | + IPage<Location> listEmptyContainerInLocation(Page<Location> page, Location location); | |
45 | 49 | } |
... | ... |
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
... | ... | @@ -2,7 +2,10 @@ package org.jeecg.modules.wms.config.location.service.impl; |
2 | 2 | |
3 | 3 | import com.aliyun.oss.ServiceException; |
4 | 4 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
5 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
5 | 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
7 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
8 | +import org.apache.ibatis.annotations.Param; | |
6 | 9 | import org.jeecg.common.api.vo.Result; |
7 | 10 | import org.jeecg.modules.wms.config.location.entity.BatchLocation; |
8 | 11 | import org.jeecg.modules.wms.config.location.entity.Location; |
... | ... | @@ -351,6 +354,11 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
351 | 354 | return null; |
352 | 355 | } |
353 | 356 | |
357 | + @Override | |
358 | + public IPage<Location> listEmptyContainerInLocation(Page page, Location location) { | |
359 | + return locationMapper.listEmptyContainerInLocation(page, location); | |
360 | + } | |
361 | + | |
354 | 362 | private boolean getOutSideCanMove(Location location) { |
355 | 363 | Location locaiton2 = getInsideNear(location); |
356 | 364 | if (locaiton2.getStatus().equals(QuantityConstant.STATUS_LOCATION_LOCK)) { |
... | ... |