Commit acd4ca868a6a6f36dbf073b6d89e9c5cfdd7c0b2
1 parent
7a154812
多仓支持提交(3)
Signed-off-by: TanYibin <5491541@qq.com>
Showing
13 changed files
with
46 additions
and
72 deletions
ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue
... | ... | @@ -81,7 +81,6 @@ |
81 | 81 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
82 | 82 | class="j-table-force-nowrap" |
83 | 83 | @change="handleTableChange"> |
84 | - | |
85 | 84 | <template slot="htmlSlot" slot-scope="text"> |
86 | 85 | <div v-html="text"></div> |
87 | 86 | </template> |
... | ... | @@ -97,20 +96,16 @@ |
97 | 96 | type="primary" |
98 | 97 | icon="download" |
99 | 98 | size="small" |
100 | - @click="downloadFile(text)"> | |
101 | - 下载 | |
99 | + @click="downloadFile(text)">下载 | |
102 | 100 | </a-button> |
103 | 101 | </template> |
104 | 102 | |
105 | 103 | <span slot="action" slot-scope="text, record"> |
106 | - <a v-if="record.status == 1" v-has="'agvTask:executeTask'" @click="executeAgvTask(record)">执行</a> | |
107 | - <a-divider type="vertical"/> | |
104 | + <a v-if="record.status == 1" v-has="'agvTask:executeTask'" @click="executeAgvTask(record)">执行<a-divider type="vertical"/></a> | |
108 | 105 | <a-popconfirm v-if="record.status < 100" title="确定删除吗?" v-has="'agvTask:delete'" @confirm="() => handleDelete(record.id)"> |
109 | - <a>删除</a> | |
106 | + <a>删除 <a-divider type="vertical"/></a> | |
110 | 107 | </a-popconfirm> |
111 | - <a-divider type="vertical"/> | |
112 | - <a v-if="record.status < 100" v-has="'agvTask:completeTask'" @click="completeAgvTask(record)">完成</a> | |
113 | - <a-divider type="vertical"/> | |
108 | + <a v-if="record.status < 100" v-has="'agvTask:completeTask'" @click="completeAgvTask(record)">完成<a-divider type="vertical"/></a> | |
114 | 109 | <a-dropdown> |
115 | 110 | <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
116 | 111 | <a-menu slot="overlay"> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/TransferTaskHeaderList.vue
... | ... | @@ -151,16 +151,13 @@ |
151 | 151 | type="primary" |
152 | 152 | icon="download" |
153 | 153 | size="small" |
154 | - @click="downloadFile(text)"> | |
155 | - 下载 | |
154 | + @click="downloadFile(text)">下载 | |
156 | 155 | </a-button> |
157 | 156 | </template> |
158 | 157 | |
159 | 158 | <span slot="action" slot-scope="text, record"> |
160 | - <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行</a> | |
161 | - <a-divider type="vertical"/> | |
162 | - <a v-if="record.status < 100" v-has="'taskHeader:completeTask'" @click="completeTask(record)">完成</a> | |
163 | - <a-divider type="vertical"/> | |
159 | + <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行<a-divider type="vertical"/></a> | |
160 | + <a v-if="record.status < 100" v-has="'taskHeader:completeTask'" @click="completeTask(record)">完成<a-divider type="vertical"/></a> | |
164 | 161 | <a-dropdown> |
165 | 162 | <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> |
166 | 163 | <a-menu slot="overlay"> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java
... | ... | @@ -186,8 +186,10 @@ public class LocationController extends JeecgController<Location, ILocationServi |
186 | 186 | if (StringUtils.isEmpty(type)) { |
187 | 187 | return Result.error("type不能为空"); |
188 | 188 | } |
189 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
190 | - return Result.OK(locationService.getAllLocation(type, warehouseCode)); | |
189 | + Location location = new Location(); | |
190 | + location.setLocationTypeCode(type); | |
191 | + location.setWarehouseCode(HuahengJwtUtil.getWarehouseCodeByToken(req)); | |
192 | + return Result.OK(locationService.getAllLocation(location)); | |
191 | 193 | } |
192 | 194 | |
193 | 195 | /** |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/mapper/LocationMapper.java
... | ... | @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
6 | 6 | import org.apache.ibatis.annotations.Param; |
7 | 7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
8 | 8 | import org.jeecg.modules.wms.config.location.entity.Location; |
9 | +import org.jeecg.modules.wms.config.location.entity.LocationInfo; | |
9 | 10 | |
10 | 11 | /** |
11 | 12 | * @Description: 库位管理 |
... | ... | @@ -15,9 +16,7 @@ import org.jeecg.modules.wms.config.location.entity.Location; |
15 | 16 | */ |
16 | 17 | public interface LocationMapper extends BaseMapper<Location> { |
17 | 18 | |
18 | - Location getAllLocation(@Param("warehouseCode") String warehouseCode, @Param("type") String type); | |
19 | - | |
20 | - int getFirstRowOfZone(@Param("warehouseCode") String warehouseCode, @Param("locationType") String locationType); | |
19 | + LocationInfo getAllLocation(Location location); | |
21 | 20 | |
22 | 21 | IPage<Location> listEmptyContainerInLocation(IPage<?> page, @Param("location") Location location); |
23 | 22 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/mapper/xml/LocationMapper.xml
... | ... | @@ -2,18 +2,17 @@ |
2 | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | 3 | <mapper namespace="org.jeecg.modules.wms.config.location.mapper.LocationMapper"> |
4 | 4 | |
5 | - <select id="getAllLocation" resultType="org.jeecg.modules.wms.config.location.entity.Location"> | |
6 | - SELECT max(row) as row, | |
7 | - max(icolumn) as icolumn, | |
8 | - max(layer) as layer, | |
9 | - max(grid) as grid | |
5 | + <select id="getAllLocation" parameterType="org.jeecg.modules.wms.config.location.entity.Location" resultType="org.jeecg.modules.wms.config.location.entity.LocationInfo"> | |
6 | + SELECT IFNULL(max(row),0) as maxRow, | |
7 | + IFNULL(max(icolumn),0) as maxLine, | |
8 | + IFNULL(max(layer),0) as maxLayer, | |
9 | + IFNULL(max(grid),0) as maxGrid, | |
10 | + IFNULL(min(row),0) as minRow | |
10 | 11 | FROM location |
11 | - WHERE warehouse_code = #{warehouseCode} | |
12 | - AND location_type_code = #{type} | |
13 | - </select> | |
14 | - | |
15 | - <select id="getFirstRowOfZone" resultType="java.lang.Integer"> | |
16 | - select min(row) from location where warehouse_code=#{warehouseCode} and location_type_code = #{locationType} | |
12 | + WHERE location_type_code = #{locationTypeCode} | |
13 | + <if test="warehouseCode != null and warehouseCode !=''"> | |
14 | + AND warehouse_code = #{warehouseCode} | |
15 | + </if> | |
17 | 16 | </select> |
18 | 17 | |
19 | 18 | <select id="listEmptyContainerInLocation" parameterType="org.jeecg.modules.wms.config.location.entity.Location" |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java
... | ... | @@ -45,7 +45,7 @@ public interface ILocationService extends IService<Location> { |
45 | 45 | |
46 | 46 | Result batchAdd(BatchLocation batchLocation); |
47 | 47 | |
48 | - LocationInfo getAllLocation(String type, String warehouseCode); | |
48 | + LocationInfo getAllLocation(Location location); | |
49 | 49 | |
50 | 50 | IPage<Location> listEmptyContainerInLocation(Page<Location> page, Location location); |
51 | 51 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
... | ... | @@ -341,19 +341,8 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
341 | 341 | } |
342 | 342 | |
343 | 343 | @Override |
344 | - public LocationInfo getAllLocation(String type, String warehouseCode) { | |
345 | - if (StringUtils.isNotEmpty(type)) { | |
346 | - Location location = locationMapper.getAllLocation(warehouseCode, type); | |
347 | - LocationInfo locationInfo = new LocationInfo(); | |
348 | - locationInfo.setMaxRow(location.getRow()); | |
349 | - locationInfo.setMaxLine(location.getIcolumn()); | |
350 | - locationInfo.setMaxLayer(location.getLayer()); | |
351 | -// locationInfo.setMaxGrid(location.getGrid()); | |
352 | - int minRow = locationMapper.getFirstRowOfZone(warehouseCode, type); | |
353 | - locationInfo.setMinRow(minRow); | |
354 | - return locationInfo; | |
355 | - } | |
356 | - return null; | |
344 | + public LocationInfo getAllLocation(Location location) { | |
345 | + return locationMapper.getAllLocation(location); | |
357 | 346 | } |
358 | 347 | |
359 | 348 | @Override |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/locationMonitor/controller/LocationMonitorController.java
... | ... | @@ -52,17 +52,18 @@ public class LocationMonitorController { |
52 | 52 | @GetMapping("/getStatus") |
53 | 53 | @ResponseBody |
54 | 54 | public Result getStatus(String zoneCode, HttpServletRequest req) { |
55 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
56 | - HashMap<String, Integer> map = new HashMap<>(); | |
57 | 55 | LambdaQueryWrapper<Location> queryWrapper = Wrappers.lambdaQuery(); |
58 | - queryWrapper.select(Location::getStatus, Location::getContainerCode).eq(Location::getZoneCode, zoneCode).eq(Location::getWarehouseCode, warehouseCode); | |
56 | + HuahengJwtUtil.setWarehouseCode(queryWrapper, Location.class, req); | |
57 | + queryWrapper.select(Location::getStatus, Location::getContainerCode).eq(Location::getZoneCode, zoneCode); | |
59 | 58 | List<Location> locationList = locationService.list(queryWrapper); |
59 | + HashMap<String, Integer> map = new HashMap<>(); | |
60 | 60 | map.put("location", locationList.size()); |
61 | 61 | // 换stream进行数据拣选速度更快 |
62 | 62 | List<Location> emptyLocationList = locationList.stream().filter(t -> StringUtils.isEmpty(t.getContainerCode())).collect(Collectors.toList()); |
63 | 63 | map.put("emptyLocation", emptyLocationList.size()); |
64 | 64 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); |
65 | - containerLambdaQueryWrapper.select(Container::getCode, Container::getStatus).eq(Container::getWarehouseCode, warehouseCode); | |
65 | + HuahengJwtUtil.setWarehouseCode(containerLambdaQueryWrapper, Container.class, req); | |
66 | + containerLambdaQueryWrapper.select(Container::getCode, Container::getStatus); | |
66 | 67 | List<Container> containerList = containerService.list(containerLambdaQueryWrapper); |
67 | 68 | List<String> containerCodeList = |
68 | 69 | containerList.stream().filter(t -> t.getStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY)).map(Container::getCode).collect(Collectors.toList()); |
... | ... | @@ -86,18 +87,18 @@ public class LocationMonitorController { |
86 | 87 | if (StringUtils.isEmpty(type)) { |
87 | 88 | return Result.error("type不能为空"); |
88 | 89 | } |
89 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
90 | 90 | /* 查询库位信息 */ |
91 | 91 | LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); |
92 | + HuahengJwtUtil.setWarehouseCode(locationLambdaQueryWrapper, Location.class, req); | |
92 | 93 | locationLambdaQueryWrapper.eq(StringUtils.isNotEmpty(row), Location::getRow, row).eq(StringUtils.isNotEmpty(line), Location::getIcolumn, line) |
93 | 94 | .eq(StringUtils.isNotEmpty(layer), Location::getLayer, layer).eq(StringUtils.isNotEmpty(grid), Location::getGrid, grid) |
94 | - .eq(Location::getWarehouseCode, warehouseCode).eq(StringUtils.isNotEmpty(type), Location::getZoneCode, type); | |
95 | + .eq(StringUtils.isNotEmpty(type), Location::getZoneCode, type); | |
95 | 96 | List<Location> locations = locationService.list(locationLambdaQueryWrapper); |
96 | 97 | List<Location> locationList = new ArrayList<>(); |
97 | 98 | |
98 | 99 | /* 查询库存明细 */ |
99 | 100 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambda = Wrappers.lambdaQuery(); |
100 | - inventoryDetailLambda.eq(InventoryDetail::getWarehouseCode, warehouseCode); | |
101 | + HuahengJwtUtil.setWarehouseCode(inventoryDetailLambda, InventoryDetail.class, req); | |
101 | 102 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambda); |
102 | 103 | |
103 | 104 | for (Location location1 : locations) { |
... | ... | @@ -163,8 +164,10 @@ public class LocationMonitorController { |
163 | 164 | if (StringUtils.isEmpty(type)) { |
164 | 165 | return Result.error("type不能为空"); |
165 | 166 | } |
166 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
167 | - return Result.ok(locationService.getAllLocation(type, warehouseCode)); | |
167 | + Location location = new Location(); | |
168 | + location.setLocationTypeCode(type); | |
169 | + location.setWarehouseCode(HuahengJwtUtil.getWarehouseCodeByToken(req)); | |
170 | + return Result.ok(locationService.getAllLocation(location)); | |
168 | 171 | } |
169 | 172 | |
170 | 173 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/locationType/controller/LocationTypeController.java
... | ... | @@ -70,8 +70,7 @@ public class LocationTypeController extends JeecgController<LocationType, ILocat |
70 | 70 | @GetMapping(value = "/list") |
71 | 71 | public Result<IPage<LocationType>> queryPageList(LocationType locationType, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
72 | 72 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
73 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
74 | - locationType.setWarehouseCode(warehouseCode); | |
73 | + HuahengJwtUtil.setWarehouseCode(req, locationType); | |
75 | 74 | QueryWrapper<LocationType> queryWrapper = QueryGenerator.initQueryWrapper(locationType, req.getParameterMap()); |
76 | 75 | Page<LocationType> page = new Page<LocationType>(pageNo, pageSize); |
77 | 76 | IPage<LocationType> pageList = locationTypeService.page(page, queryWrapper); |
... | ... | @@ -88,10 +87,7 @@ public class LocationTypeController extends JeecgController<LocationType, ILocat |
88 | 87 | @RequiresPermissions("locationType:add") |
89 | 88 | @PostMapping(value = "/add") |
90 | 89 | public Result<String> add(@RequestBody LocationType locationType, HttpServletRequest req) { |
91 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
92 | - if (StringUtils.isNotEmpty(warehouseCode)) { | |
93 | - locationType.setWarehouseCode(warehouseCode); | |
94 | - } | |
90 | + HuahengJwtUtil.setWarehouseCode(req, locationType); | |
95 | 91 | locationTypeService.save(locationType); |
96 | 92 | return Result.OK("添加成功!"); |
97 | 93 | } |
... | ... | @@ -177,9 +173,8 @@ public class LocationTypeController extends JeecgController<LocationType, ILocat |
177 | 173 | |
178 | 174 | @RequestMapping(value = "/getLocationTypeList") |
179 | 175 | public Result<?> getLocationTypeList(HttpServletRequest req) { |
180 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
181 | 176 | LambdaQueryWrapper<LocationType> locationTypeLambdaQueryWrapper = Wrappers.lambdaQuery(); |
182 | - locationTypeLambdaQueryWrapper.eq(LocationType::getWarehouseCode, warehouseCode); | |
177 | + HuahengJwtUtil.setWarehouseCode(locationTypeLambdaQueryWrapper, LocationType.class, req); | |
183 | 178 | List<LocationType> locationTypeList = locationTypeService.list(locationTypeLambdaQueryWrapper); |
184 | 179 | return Result.OK(locationTypeList); |
185 | 180 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/zone/controller/ZoneController.java
... | ... | @@ -180,9 +180,8 @@ public class ZoneController extends JeecgController<Zone, IZoneService> { |
180 | 180 | */ |
181 | 181 | @RequestMapping(value = "/getZoneList") |
182 | 182 | public Result<?> getZoneList(HttpServletRequest req) { |
183 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
184 | 183 | LambdaQueryWrapper<Zone> zoneLambdaQueryWrapper = Wrappers.lambdaQuery(); |
185 | - zoneLambdaQueryWrapper.eq(Zone::getWarehouseCode, warehouseCode); | |
184 | + HuahengJwtUtil.setWarehouseCode(zoneLambdaQueryWrapper, Zone.class, req); | |
186 | 185 | List<Zone> zoneList = zoneService.list(zoneLambdaQueryWrapper); |
187 | 186 | return Result.OK(zoneList); |
188 | 187 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryTransaction/controller/InventoryTransactionController.java
... | ... | @@ -52,8 +52,7 @@ public class InventoryTransactionController extends JeecgController<InventoryTra |
52 | 52 | public Result<IPage<InventoryTransaction>> queryPageList(InventoryTransaction inventoryTransaction, |
53 | 53 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
54 | 54 | HttpServletRequest req) { |
55 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
56 | - inventoryTransaction.setWarehouseCode(warehouseCode); | |
55 | + HuahengJwtUtil.setWarehouseCode(req, inventoryTransaction); | |
57 | 56 | QueryWrapper<InventoryTransaction> queryWrapper = QueryGenerator.initQueryWrapper(inventoryTransaction, req.getParameterMap()); |
58 | 57 | Page<InventoryTransaction> page = new Page<InventoryTransaction>(pageNo, pageSize); |
59 | 58 | IPage<InventoryTransaction> pageList = inventoryTransactionService.page(page, queryWrapper); |
... | ... | @@ -69,8 +68,7 @@ public class InventoryTransactionController extends JeecgController<InventoryTra |
69 | 68 | @ApiOperation(value = "库存交易记录-添加", notes = "库存交易记录-添加") |
70 | 69 | @PostMapping(value = "/add") |
71 | 70 | public Result<String> add(@RequestBody InventoryTransaction inventoryTransaction, HttpServletRequest req) { |
72 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
73 | - inventoryTransaction.setWarehouseCode(warehouseCode); | |
71 | + HuahengJwtUtil.setWarehouseCode(req, inventoryTransaction); | |
74 | 72 | inventoryTransactionService.save(inventoryTransaction); |
75 | 73 | return Result.OK("添加成功!"); |
76 | 74 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/controller/AgvTaskController.java
... | ... | @@ -50,8 +50,7 @@ public class AgvTaskController extends JeecgController<AgvTask, IAgvTaskService> |
50 | 50 | @GetMapping(value = "/list") |
51 | 51 | public Result<IPage<AgvTask>> queryPageList(AgvTask agvTask, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
52 | 52 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
53 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
54 | - agvTask.setWarehouseCode(warehouseCode); | |
53 | + HuahengJwtUtil.setWarehouseCode(req, agvTask); | |
55 | 54 | QueryWrapper<AgvTask> queryWrapper = QueryGenerator.initQueryWrapper(agvTask, req.getParameterMap()); |
56 | 55 | Page<AgvTask> page = new Page<AgvTask>(pageNo, pageSize); |
57 | 56 | IPage<AgvTask> pageList = agvTaskService.page(page, queryWrapper); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
... | ... | @@ -100,8 +100,7 @@ public class TaskHeaderController extends HuahengBaseController { |
100 | 100 | @GetMapping(value = "/list") |
101 | 101 | public Result<IPage<TaskHeader>> queryPageList(TaskHeader taskHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
102 | 102 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
103 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
104 | - taskHeader.setWarehouseCode(warehouseCode); | |
103 | + HuahengJwtUtil.setWarehouseCode(req, taskHeader); | |
105 | 104 | QueryWrapper<TaskHeader> queryWrapper = QueryGenerator.initQueryWrapper(taskHeader, req.getParameterMap()); |
106 | 105 | Page<TaskHeader> page = new Page<TaskHeader>(pageNo, pageSize); |
107 | 106 | IPage<TaskHeader> pageList = taskHeaderService.page(page, queryWrapper); |
... | ... |