Commit 5b9418461ce3a92053e99ab097e31a60571d8ebd
1 parent
b002b133
增加多仓判断
Showing
17 changed files
with
633 additions
and
718 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/address/controller/AddressController.java
1 | package org.jeecg.modules.wms.config.address.controller; | 1 | package org.jeecg.modules.wms.config.address.controller; |
2 | 2 | ||
3 | import java.util.Arrays; | 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; | 4 | + |
10 | import javax.servlet.http.HttpServletRequest; | 5 | import javax.servlet.http.HttpServletRequest; |
11 | import javax.servlet.http.HttpServletResponse; | 6 | import javax.servlet.http.HttpServletResponse; |
12 | 7 | ||
13 | import org.apache.shiro.authz.annotation.RequiresPermissions; | 8 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
14 | import org.jeecg.common.api.vo.Result; | 9 | import org.jeecg.common.api.vo.Result; |
10 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
11 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
15 | import org.jeecg.common.system.query.QueryGenerator; | 12 | import org.jeecg.common.system.query.QueryGenerator; |
16 | -import org.jeecg.utils.HuahengJwtUtil; | ||
17 | -import org.jeecg.common.util.oConvertUtils; | ||
18 | - | ||
19 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
20 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
21 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
22 | -import lombok.extern.slf4j.Slf4j; | ||
23 | - | ||
24 | import org.jeecg.modules.wms.config.address.entity.Address; | 13 | import org.jeecg.modules.wms.config.address.entity.Address; |
25 | import org.jeecg.modules.wms.config.address.service.IAddressService; | 14 | import org.jeecg.modules.wms.config.address.service.IAddressService; |
15 | +import org.jeecg.utils.HuahengJwtUtil; | ||
26 | import org.jeecg.utils.StringUtils; | 16 | import org.jeecg.utils.StringUtils; |
27 | -import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
28 | -import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
29 | -import org.jeecgframework.poi.excel.entity.ExportParams; | ||
30 | -import org.jeecgframework.poi.excel.entity.ImportParams; | ||
31 | -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
32 | -import org.jeecg.common.system.base.controller.JeecgController; | ||
33 | import org.springframework.beans.factory.annotation.Autowired; | 17 | import org.springframework.beans.factory.annotation.Autowired; |
34 | import org.springframework.web.bind.annotation.*; | 18 | import org.springframework.web.bind.annotation.*; |
35 | -import org.springframework.web.multipart.MultipartFile; | ||
36 | -import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
37 | import org.springframework.web.servlet.ModelAndView; | 19 | import org.springframework.web.servlet.ModelAndView; |
38 | -import com.alibaba.fastjson.JSON; | 20 | + |
21 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
22 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
23 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
24 | + | ||
39 | import io.swagger.annotations.Api; | 25 | import io.swagger.annotations.Api; |
40 | import io.swagger.annotations.ApiOperation; | 26 | import io.swagger.annotations.ApiOperation; |
41 | -import org.jeecg.common.aspect.annotation.AutoLog; | 27 | +import lombok.extern.slf4j.Slf4j; |
42 | 28 | ||
43 | /** | 29 | /** |
44 | * @Description: 接口地址 | 30 | * @Description: 接口地址 |
@@ -67,6 +53,8 @@ public class AddressController extends JeecgController<Address, IAddressService> | @@ -67,6 +53,8 @@ public class AddressController extends JeecgController<Address, IAddressService> | ||
67 | @GetMapping(value = "/list") | 53 | @GetMapping(value = "/list") |
68 | public Result<IPage<Address>> queryPageList(Address address, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 54 | public Result<IPage<Address>> queryPageList(Address address, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
69 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | 55 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
56 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
57 | + address.setWarehouseCode(warehouseCode); | ||
70 | QueryWrapper<Address> queryWrapper = QueryGenerator.initQueryWrapper(address, req.getParameterMap()); | 58 | QueryWrapper<Address> queryWrapper = QueryGenerator.initQueryWrapper(address, req.getParameterMap()); |
71 | Page<Address> page = new Page<Address>(pageNo, pageSize); | 59 | Page<Address> page = new Page<Address>(pageNo, pageSize); |
72 | IPage<Address> pageList = addressService.page(page, queryWrapper); | 60 | IPage<Address> pageList = addressService.page(page, queryWrapper); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/agvPort/controller/AgvPortController.java
@@ -12,6 +12,7 @@ import org.jeecg.common.system.base.controller.JeecgController; | @@ -12,6 +12,7 @@ import org.jeecg.common.system.base.controller.JeecgController; | ||
12 | import org.jeecg.common.system.query.QueryGenerator; | 12 | import org.jeecg.common.system.query.QueryGenerator; |
13 | import org.jeecg.modules.wms.config.agvPort.entity.AgvPort; | 13 | import org.jeecg.modules.wms.config.agvPort.entity.AgvPort; |
14 | import org.jeecg.modules.wms.config.agvPort.service.IAgvPortService; | 14 | import org.jeecg.modules.wms.config.agvPort.service.IAgvPortService; |
15 | +import org.jeecg.utils.HuahengJwtUtil; | ||
15 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
16 | import org.springframework.web.bind.annotation.*; | 17 | import org.springframework.web.bind.annotation.*; |
17 | import org.springframework.web.servlet.ModelAndView; | 18 | import org.springframework.web.servlet.ModelAndView; |
@@ -51,6 +52,8 @@ public class AgvPortController extends JeecgController<AgvPort, IAgvPortService> | @@ -51,6 +52,8 @@ public class AgvPortController extends JeecgController<AgvPort, IAgvPortService> | ||
51 | @GetMapping(value = "/list") | 52 | @GetMapping(value = "/list") |
52 | public Result<IPage<AgvPort>> queryPageList(AgvPort agvPort, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 53 | public Result<IPage<AgvPort>> queryPageList(AgvPort agvPort, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
53 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | 54 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
55 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
56 | + agvPort.setWarehouseCode(warehouseCode); | ||
54 | QueryWrapper<AgvPort> queryWrapper = QueryGenerator.initQueryWrapper(agvPort, req.getParameterMap()); | 57 | QueryWrapper<AgvPort> queryWrapper = QueryGenerator.initQueryWrapper(agvPort, req.getParameterMap()); |
55 | Page<AgvPort> page = new Page<AgvPort>(pageNo, pageSize); | 58 | Page<AgvPort> page = new Page<AgvPort>(pageNo, pageSize); |
56 | IPage<AgvPort> pageList = agvPortService.page(page, queryWrapper); | 59 | IPage<AgvPort> pageList = agvPortService.page(page, queryWrapper); |
@@ -66,7 +69,9 @@ public class AgvPortController extends JeecgController<AgvPort, IAgvPortService> | @@ -66,7 +69,9 @@ public class AgvPortController extends JeecgController<AgvPort, IAgvPortService> | ||
66 | @ApiOperation(value = "AGV点位-添加", notes = "AGV点位-添加") | 69 | @ApiOperation(value = "AGV点位-添加", notes = "AGV点位-添加") |
67 | @PostMapping(value = "/add") | 70 | @PostMapping(value = "/add") |
68 | @RequiresPermissions("agvPort:add") | 71 | @RequiresPermissions("agvPort:add") |
69 | - public Result<String> add(@RequestBody AgvPort agvPort) { | 72 | + public Result<String> add(@RequestBody AgvPort agvPort, HttpServletRequest req) { |
73 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
74 | + agvPort.setWarehouseCode(warehouseCode); | ||
70 | agvPortService.save(agvPort); | 75 | agvPortService.save(agvPort); |
71 | return Result.OK("添加成功!"); | 76 | return Result.OK("添加成功!"); |
72 | } | 77 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/cycleCountPreference/controller/CycleCountPreferenceController.java
@@ -2,46 +2,32 @@ package org.jeecg.modules.wms.config.cycleCountPreference.controller; | @@ -2,46 +2,32 @@ package org.jeecg.modules.wms.config.cycleCountPreference.controller; | ||
2 | 2 | ||
3 | import java.util.Arrays; | 3 | import java.util.Arrays; |
4 | import java.util.List; | 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; | 5 | + |
10 | import javax.servlet.http.HttpServletRequest; | 6 | import javax.servlet.http.HttpServletRequest; |
11 | import javax.servlet.http.HttpServletResponse; | 7 | import javax.servlet.http.HttpServletResponse; |
12 | 8 | ||
13 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
14 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
15 | import org.apache.shiro.authz.annotation.RequiresPermissions; | 9 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
16 | import org.jeecg.common.api.vo.Result; | 10 | import org.jeecg.common.api.vo.Result; |
11 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
12 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
17 | import org.jeecg.common.system.query.QueryGenerator; | 13 | import org.jeecg.common.system.query.QueryGenerator; |
18 | -import org.jeecg.modules.wms.config.company.entity.Company; | ||
19 | -import org.jeecg.utils.HuahengJwtUtil; | ||
20 | -import org.jeecg.common.util.oConvertUtils; | ||
21 | - | ||
22 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
23 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
24 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
25 | -import lombok.extern.slf4j.Slf4j; | ||
26 | - | ||
27 | import org.jeecg.modules.wms.config.cycleCountPreference.entity.CycleCountPreference; | 14 | import org.jeecg.modules.wms.config.cycleCountPreference.entity.CycleCountPreference; |
28 | import org.jeecg.modules.wms.config.cycleCountPreference.service.ICycleCountPreferenceService; | 15 | import org.jeecg.modules.wms.config.cycleCountPreference.service.ICycleCountPreferenceService; |
16 | +import org.jeecg.utils.HuahengJwtUtil; | ||
29 | import org.jeecg.utils.StringUtils; | 17 | import org.jeecg.utils.StringUtils; |
30 | -import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
31 | -import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
32 | -import org.jeecgframework.poi.excel.entity.ExportParams; | ||
33 | -import org.jeecgframework.poi.excel.entity.ImportParams; | ||
34 | -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
35 | -import org.jeecg.common.system.base.controller.JeecgController; | ||
36 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
37 | import org.springframework.web.bind.annotation.*; | 19 | import org.springframework.web.bind.annotation.*; |
38 | -import org.springframework.web.multipart.MultipartFile; | ||
39 | -import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
40 | import org.springframework.web.servlet.ModelAndView; | 20 | import org.springframework.web.servlet.ModelAndView; |
41 | -import com.alibaba.fastjson.JSON; | 21 | + |
22 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
23 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
24 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
25 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
26 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
27 | + | ||
42 | import io.swagger.annotations.Api; | 28 | import io.swagger.annotations.Api; |
43 | import io.swagger.annotations.ApiOperation; | 29 | import io.swagger.annotations.ApiOperation; |
44 | -import org.jeecg.common.aspect.annotation.AutoLog; | 30 | +import lombok.extern.slf4j.Slf4j; |
45 | 31 | ||
46 | /** | 32 | /** |
47 | * @Description: 盘点首选项 | 33 | * @Description: 盘点首选项 |
@@ -71,6 +57,8 @@ public class CycleCountPreferenceController extends JeecgController<CycleCountPr | @@ -71,6 +57,8 @@ public class CycleCountPreferenceController extends JeecgController<CycleCountPr | ||
71 | public Result<IPage<CycleCountPreference>> queryPageList(CycleCountPreference cycleCountPreference, | 57 | public Result<IPage<CycleCountPreference>> queryPageList(CycleCountPreference cycleCountPreference, |
72 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | 58 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
73 | HttpServletRequest req) { | 59 | HttpServletRequest req) { |
60 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
61 | + cycleCountPreference.setWarehouseCode(warehouseCode); | ||
74 | QueryWrapper<CycleCountPreference> queryWrapper = QueryGenerator.initQueryWrapper(cycleCountPreference, req.getParameterMap()); | 62 | QueryWrapper<CycleCountPreference> queryWrapper = QueryGenerator.initQueryWrapper(cycleCountPreference, req.getParameterMap()); |
75 | Page<CycleCountPreference> page = new Page<CycleCountPreference>(pageNo, pageSize); | 63 | Page<CycleCountPreference> page = new Page<CycleCountPreference>(pageNo, pageSize); |
76 | IPage<CycleCountPreference> pageList = cycleCountPreferenceService.page(page, queryWrapper); | 64 | IPage<CycleCountPreference> pageList = cycleCountPreferenceService.page(page, queryWrapper); |
@@ -137,8 +125,6 @@ public class CycleCountPreferenceController extends JeecgController<CycleCountPr | @@ -137,8 +125,6 @@ public class CycleCountPreferenceController extends JeecgController<CycleCountPr | ||
137 | return Result.OK("批量删除成功!"); | 125 | return Result.OK("批量删除成功!"); |
138 | } | 126 | } |
139 | 127 | ||
140 | - | ||
141 | - | ||
142 | /** | 128 | /** |
143 | * 获得盘点类型信息 | 129 | * 获得盘点类型信息 |
144 | * @param req | 130 | * @param req |
@@ -152,8 +138,6 @@ public class CycleCountPreferenceController extends JeecgController<CycleCountPr | @@ -152,8 +138,6 @@ public class CycleCountPreferenceController extends JeecgController<CycleCountPr | ||
152 | return Result.OK(cycleCountPreferenceList); | 138 | return Result.OK(cycleCountPreferenceList); |
153 | } | 139 | } |
154 | 140 | ||
155 | - | ||
156 | - | ||
157 | /** | 141 | /** |
158 | * 通过id查询 | 142 | * 通过id查询 |
159 | * @param id | 143 | * @param id |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/locationMonitor/controller/LocationMonitorController.java
@@ -51,18 +51,19 @@ public class LocationMonitorController { | @@ -51,18 +51,19 @@ public class LocationMonitorController { | ||
51 | */ | 51 | */ |
52 | @GetMapping("/getStatus") | 52 | @GetMapping("/getStatus") |
53 | @ResponseBody | 53 | @ResponseBody |
54 | - public Result getStatus(String zoneCode) { | 54 | + public Result getStatus(String zoneCode, HttpServletRequest req) { |
55 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
55 | HashMap<String, Integer> map = new HashMap<>(); | 56 | HashMap<String, Integer> map = new HashMap<>(); |
56 | LambdaQueryWrapper<Location> queryWrapper = Wrappers.lambdaQuery(); | 57 | LambdaQueryWrapper<Location> queryWrapper = Wrappers.lambdaQuery(); |
57 | - queryWrapper.select(Location::getStatus, Location::getContainerCode).eq(Location::getZoneCode, zoneCode); | 58 | + queryWrapper.select(Location::getStatus, Location::getContainerCode).eq(Location::getZoneCode, zoneCode).eq(Location::getWarehouseCode, warehouseCode); |
58 | List<Location> locationList = locationService.list(queryWrapper); | 59 | List<Location> locationList = locationService.list(queryWrapper); |
59 | map.put("location", locationList.size()); | 60 | map.put("location", locationList.size()); |
60 | // 换stream进行数据拣选速度更快 | 61 | // 换stream进行数据拣选速度更快 |
61 | List<Location> emptyLocationList = locationList.stream().filter(t -> StringUtils.isEmpty(t.getContainerCode())).collect(Collectors.toList()); | 62 | List<Location> emptyLocationList = locationList.stream().filter(t -> StringUtils.isEmpty(t.getContainerCode())).collect(Collectors.toList()); |
62 | map.put("emptyLocation", emptyLocationList.size()); | 63 | map.put("emptyLocation", emptyLocationList.size()); |
63 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | 64 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); |
64 | - containerLambdaQueryWrapper.select(Container::getCode, Container::getStatus); | ||
65 | - List<Container> containerList = containerService.list(); | 65 | + containerLambdaQueryWrapper.select(Container::getCode, Container::getStatus).eq(Container::getWarehouseCode, warehouseCode); |
66 | + List<Container> containerList = containerService.list(containerLambdaQueryWrapper); | ||
66 | List<String> containerCodeList = | 67 | List<String> containerCodeList = |
67 | containerList.stream().filter(t -> t.getStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY)).map(Container::getCode).collect(Collectors.toList()); | 68 | containerList.stream().filter(t -> t.getStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY)).map(Container::getCode).collect(Collectors.toList()); |
68 | List<Location> haveEmptyContainLocation = locationList.stream().filter(t -> t.getStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY) | 69 | List<Location> haveEmptyContainLocation = locationList.stream().filter(t -> t.getStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY) |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/material/controller/MaterialController.java
@@ -56,6 +56,8 @@ public class MaterialController extends JeecgController<Material, IMaterialServi | @@ -56,6 +56,8 @@ public class MaterialController extends JeecgController<Material, IMaterialServi | ||
56 | @GetMapping(value = "/list") | 56 | @GetMapping(value = "/list") |
57 | public Result<IPage<Material>> queryPageList(Material material, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 57 | public Result<IPage<Material>> queryPageList(Material material, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
58 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | 58 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
59 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
60 | + material.setWarehouseCode(warehouseCode); | ||
59 | QueryWrapper<Material> queryWrapper = QueryGenerator.initQueryWrapper(material, req.getParameterMap()); | 61 | QueryWrapper<Material> queryWrapper = QueryGenerator.initQueryWrapper(material, req.getParameterMap()); |
60 | Page<Material> page = new Page<Material>(pageNo, pageSize); | 62 | Page<Material> page = new Page<Material>(pageNo, pageSize); |
61 | IPage<Material> pageList = materialService.page(page, queryWrapper); | 63 | IPage<Material> pageList = materialService.page(page, queryWrapper); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/InventoryMaterialSummary/controller/InventoryMaterialSummaryController.java
1 | package org.jeecg.modules.wms.inventory.InventoryMaterialSummary.controller; | 1 | package org.jeecg.modules.wms.inventory.InventoryMaterialSummary.controller; |
2 | 2 | ||
3 | -import java.util.Arrays; | ||
4 | -import java.util.Collections; | ||
5 | import java.util.List; | 3 | import java.util.List; |
6 | -import java.util.Map; | ||
7 | -import java.util.stream.Collectors; | ||
8 | -import java.io.IOException; | ||
9 | -import java.io.UnsupportedEncodingException; | ||
10 | -import java.net.URLDecoder; | 4 | + |
11 | import javax.annotation.Resource; | 5 | import javax.annotation.Resource; |
12 | import javax.servlet.http.HttpServletRequest; | 6 | import javax.servlet.http.HttpServletRequest; |
13 | import javax.servlet.http.HttpServletResponse; | 7 | import javax.servlet.http.HttpServletResponse; |
14 | 8 | ||
15 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
16 | import org.jeecg.common.api.vo.Result; | 9 | import org.jeecg.common.api.vo.Result; |
10 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
17 | import org.jeecg.common.system.query.QueryGenerator; | 11 | import org.jeecg.common.system.query.QueryGenerator; |
18 | -import org.jeecg.common.util.oConvertUtils; | ||
19 | import org.jeecg.modules.wms.inventory.InventoryMaterialSummary.service.IInventoryMaterialSummaryService; | 12 | import org.jeecg.modules.wms.inventory.InventoryMaterialSummary.service.IInventoryMaterialSummaryService; |
20 | - | ||
21 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
22 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
23 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
24 | -import lombok.extern.slf4j.Slf4j; | ||
25 | - | ||
26 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 13 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
27 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.impl.InventoryDetailServiceImpl; | 14 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.impl.InventoryDetailServiceImpl; |
15 | +import org.jeecg.utils.HuahengJwtUtil; | ||
28 | import org.jeecg.utils.StringUtils; | 16 | import org.jeecg.utils.StringUtils; |
29 | -import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
30 | -import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
31 | -import org.jeecgframework.poi.excel.entity.ExportParams; | ||
32 | -import org.jeecgframework.poi.excel.entity.ImportParams; | ||
33 | -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
34 | -import org.jeecg.common.system.base.controller.JeecgController; | ||
35 | -import org.springframework.beans.factory.annotation.Autowired; | ||
36 | import org.springframework.web.bind.annotation.*; | 17 | import org.springframework.web.bind.annotation.*; |
37 | -import org.springframework.web.multipart.MultipartFile; | ||
38 | -import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
39 | import org.springframework.web.servlet.ModelAndView; | 18 | import org.springframework.web.servlet.ModelAndView; |
40 | -import com.alibaba.fastjson.JSON; | 19 | + |
20 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
21 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
22 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
23 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
24 | + | ||
41 | import io.swagger.annotations.Api; | 25 | import io.swagger.annotations.Api; |
42 | import io.swagger.annotations.ApiOperation; | 26 | import io.swagger.annotations.ApiOperation; |
43 | -import org.jeecg.common.aspect.annotation.AutoLog; | 27 | +import lombok.extern.slf4j.Slf4j; |
44 | 28 | ||
45 | - /** | 29 | +/** |
46 | * @Description: 物料汇总主表 | 30 | * @Description: 物料汇总主表 |
47 | - * @Author: jeecg-boot | ||
48 | - * @Date: 2023-02-22 | ||
49 | - * @Version: V1.0 | 31 | + * @Author: jeecg-boot |
32 | + * @Date: 2023-02-22 | ||
33 | + * @Version: V1.0 | ||
50 | */ | 34 | */ |
51 | -@Api(tags="物料汇总主表") | 35 | +@Api(tags = "物料汇总主表") |
52 | @RestController | 36 | @RestController |
53 | @RequestMapping("/InventoryMaterialSummary/inventoryMaterialSummary") | 37 | @RequestMapping("/InventoryMaterialSummary/inventoryMaterialSummary") |
54 | @Slf4j | 38 | @Slf4j |
55 | public class InventoryMaterialSummaryController extends JeecgController<InventoryDetail, IInventoryMaterialSummaryService> { | 39 | public class InventoryMaterialSummaryController extends JeecgController<InventoryDetail, IInventoryMaterialSummaryService> { |
56 | - @Resource | ||
57 | - private InventoryDetailServiceImpl inventoryDetailServiceImpl; | ||
58 | - @Resource | ||
59 | - private IInventoryMaterialSummaryService inventoryMaterialSummaryService; | ||
60 | - | ||
61 | - | ||
62 | - /** | ||
63 | - * 分页列表查询 | ||
64 | - * | ||
65 | - * @param pageNo | ||
66 | - * @param pageSize | ||
67 | - * @param req | ||
68 | - * @return | ||
69 | - */ | ||
70 | - @ApiOperation(value="物料汇总主表-分页列表查询", notes="物料汇总主表-分页列表查询") | ||
71 | - @GetMapping(value = "/list") | ||
72 | - public Result<IPage<InventoryDetail>> queryPageList(InventoryDetail inventoryDetail, | ||
73 | - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
74 | - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
75 | - HttpServletRequest req) { | ||
76 | - QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); | ||
77 | - Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); | ||
78 | - IPage<InventoryDetail> pageList = inventoryDetailServiceImpl.page(page, queryWrapper); | ||
79 | - //筛选库存汇总数据的专用方法 | ||
80 | - List<InventoryDetail> details = inventoryMaterialSummaryService.duplicateRemoval(pageList.getRecords()); | ||
81 | - pageList.setRecords(null); | ||
82 | - pageList.setRecords(details); | ||
83 | - return Result.OK(pageList); | ||
84 | - } | ||
85 | - | 40 | + @Resource |
41 | + private InventoryDetailServiceImpl inventoryDetailServiceImpl; | ||
42 | + @Resource | ||
43 | + private IInventoryMaterialSummaryService inventoryMaterialSummaryService; | ||
86 | 44 | ||
45 | + /** | ||
46 | + * 分页列表查询 | ||
47 | + * @param pageNo | ||
48 | + * @param pageSize | ||
49 | + * @param req | ||
50 | + * @return | ||
51 | + */ | ||
52 | + @ApiOperation(value = "物料汇总主表-分页列表查询", notes = "物料汇总主表-分页列表查询") | ||
53 | + @GetMapping(value = "/list") | ||
54 | + public Result<IPage<InventoryDetail>> queryPageList(InventoryDetail inventoryDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||
55 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | ||
56 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
57 | + inventoryDetail.setWarehouseCode(warehouseCode); | ||
58 | + QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); | ||
59 | + Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); | ||
60 | + IPage<InventoryDetail> pageList = inventoryDetailServiceImpl.page(page, queryWrapper); | ||
61 | + // 筛选库存汇总数据的专用方法 | ||
62 | + List<InventoryDetail> details = inventoryMaterialSummaryService.duplicateRemoval(pageList.getRecords()); | ||
63 | + pageList.setRecords(null); | ||
64 | + pageList.setRecords(details); | ||
65 | + return Result.OK(pageList); | ||
66 | + } | ||
87 | 67 | ||
88 | - /** | ||
89 | - * 分页列表明细情况 | ||
90 | - * | ||
91 | - * @param pageNo | ||
92 | - * @param pageSize | ||
93 | - * @param req | ||
94 | - * @return | ||
95 | - */ | ||
96 | - @ApiOperation(value="物料汇总主表-库存汇总明细子单", notes="物料汇总主表-库存汇总明细子单") | ||
97 | - @GetMapping(value = "/inventoryMaterialSummaryChild") | ||
98 | - public Result<IPage<InventoryDetail>> inventoryMaterialSummaryChild(InventoryDetail inventoryDetail, | ||
99 | - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
100 | - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
101 | - HttpServletRequest req) { | ||
102 | - inventoryDetail=inventoryDetailServiceImpl.getById(inventoryDetail.getId()); | ||
103 | - LambdaQueryWrapper<InventoryDetail> queryWrapper = new LambdaQueryWrapper<>(); | ||
104 | - queryWrapper.eq(InventoryDetail::getMaterialCode,inventoryDetail.getMaterialCode()) | ||
105 | - .eq(InventoryDetail::getMaterialName,inventoryDetail.getMaterialName()) | ||
106 | - .eq(StringUtils.isNotEmpty(inventoryDetail.getMaterialSpec()),InventoryDetail::getMaterialSpec,inventoryDetail.getMaterialSpec()) | ||
107 | - .eq(StringUtils.isNotEmpty(inventoryDetail.getMaterialUnit()),InventoryDetail::getMaterialUnit,inventoryDetail.getMaterialUnit()); | 68 | + /** |
69 | + * 分页列表明细情况 | ||
70 | + * @param pageNo | ||
71 | + * @param pageSize | ||
72 | + * @param req | ||
73 | + * @return | ||
74 | + */ | ||
75 | + @ApiOperation(value = "物料汇总主表-库存汇总明细子单", notes = "物料汇总主表-库存汇总明细子单") | ||
76 | + @GetMapping(value = "/inventoryMaterialSummaryChild") | ||
77 | + public Result<IPage<InventoryDetail>> inventoryMaterialSummaryChild(InventoryDetail inventoryDetail, | ||
78 | + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | ||
79 | + HttpServletRequest req) { | ||
80 | + inventoryDetail = inventoryDetailServiceImpl.getById(inventoryDetail.getId()); | ||
81 | + LambdaQueryWrapper<InventoryDetail> queryWrapper = new LambdaQueryWrapper<>(); | ||
82 | + queryWrapper.eq(InventoryDetail::getMaterialCode, inventoryDetail.getMaterialCode()).eq(InventoryDetail::getMaterialName, inventoryDetail.getMaterialName()) | ||
83 | + .eq(StringUtils.isNotEmpty(inventoryDetail.getMaterialSpec()), InventoryDetail::getMaterialSpec, inventoryDetail.getMaterialSpec()) | ||
84 | + .eq(StringUtils.isNotEmpty(inventoryDetail.getMaterialUnit()), InventoryDetail::getMaterialUnit, inventoryDetail.getMaterialUnit()); | ||
108 | 85 | ||
109 | - Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); | ||
110 | - IPage<InventoryDetail> pageList = inventoryDetailServiceImpl.page(page, queryWrapper); | 86 | + Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); |
87 | + IPage<InventoryDetail> pageList = inventoryDetailServiceImpl.page(page, queryWrapper); | ||
111 | 88 | ||
112 | - return Result.OK(pageList); | ||
113 | - } | 89 | + return Result.OK(pageList); |
90 | + } | ||
114 | 91 | ||
115 | /** | 92 | /** |
116 | - * 导出excel | ||
117 | - * | ||
118 | - * @param request | ||
119 | - * @param inventoryMaterialSummary | ||
120 | - */ | 93 | + * 导出excel |
94 | + * @param request | ||
95 | + * @param inventoryMaterialSummary | ||
96 | + */ | ||
121 | @RequestMapping(value = "/exportXls") | 97 | @RequestMapping(value = "/exportXls") |
122 | public ModelAndView exportXls(HttpServletRequest request, InventoryDetail inventoryMaterialSummary) { | 98 | public ModelAndView exportXls(HttpServletRequest request, InventoryDetail inventoryMaterialSummary) { |
123 | return super.exportXls(request, inventoryMaterialSummary, InventoryDetail.class, "物料汇总主表"); | 99 | return super.exportXls(request, inventoryMaterialSummary, InventoryDetail.class, "物料汇总主表"); |
124 | } | 100 | } |
125 | 101 | ||
126 | /** | 102 | /** |
127 | - * 通过excel导入数据 | ||
128 | - * | ||
129 | - * @param request | ||
130 | - * @param response | ||
131 | - * @return | ||
132 | - */ | 103 | + * 通过excel导入数据 |
104 | + * @param request | ||
105 | + * @param response | ||
106 | + * @return | ||
107 | + */ | ||
133 | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | 108 | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
134 | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | 109 | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
135 | return super.importExcel(request, response, InventoryDetail.class); | 110 | return super.importExcel(request, response, InventoryDetail.class); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/controller/InventoryHeaderController.java
1 | package org.jeecg.modules.wms.inventory.inventoryHeader.controller; | 1 | package org.jeecg.modules.wms.inventory.inventoryHeader.controller; |
2 | 2 | ||
3 | -import org.jeecg.common.system.query.QueryGenerator; | ||
4 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
5 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
6 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
7 | -import lombok.extern.slf4j.Slf4j; | ||
8 | -import org.jeecg.common.system.base.controller.JeecgController; | 3 | +import java.io.IOException; |
4 | +import java.util.Arrays; | ||
5 | +import java.util.List; | ||
6 | +import java.util.Map; | ||
7 | +import java.util.stream.Collectors; | ||
8 | + | ||
9 | +import javax.servlet.http.HttpServletRequest; | ||
10 | +import javax.servlet.http.HttpServletResponse; | ||
11 | + | ||
12 | +import org.apache.shiro.SecurityUtils; | ||
9 | import org.jeecg.common.api.vo.Result; | 13 | import org.jeecg.common.api.vo.Result; |
10 | -import org.jeecg.utils.HuahengJwtUtil; | 14 | +import org.jeecg.common.aspect.annotation.AutoLog; |
15 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
16 | +import org.jeecg.common.system.query.QueryGenerator; | ||
17 | +import org.jeecg.common.system.vo.LoginUser; | ||
18 | +import org.jeecg.common.util.oConvertUtils; | ||
11 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 19 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
12 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; | 20 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; |
13 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 21 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
14 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; | 22 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; |
23 | +import org.jeecg.utils.HuahengJwtUtil; | ||
24 | +import org.jeecg.utils.StringUtils; | ||
15 | import org.jeecg.utils.constant.QuantityConstant; | 25 | import org.jeecg.utils.constant.QuantityConstant; |
16 | -import org.springframework.beans.factory.annotation.Autowired; | ||
17 | -import org.springframework.web.bind.annotation.*; | ||
18 | -import javax.servlet.http.HttpServletRequest; | ||
19 | -import javax.servlet.http.HttpServletResponse; | ||
20 | -import org.springframework.web.servlet.ModelAndView; | ||
21 | -import java.util.Arrays; | ||
22 | -import org.jeecg.common.util.oConvertUtils; | ||
23 | -import io.swagger.annotations.Api; | ||
24 | -import io.swagger.annotations.ApiOperation; | ||
25 | -import org.jeecg.common.aspect.annotation.AutoLog; | ||
26 | -import org.apache.shiro.SecurityUtils; | ||
27 | -import org.jeecg.common.system.vo.LoginUser; | ||
28 | import org.jeecgframework.poi.excel.ExcelImportUtil; | 26 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
29 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; | 27 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
30 | import org.jeecgframework.poi.excel.entity.ExportParams; | 28 | import org.jeecgframework.poi.excel.entity.ExportParams; |
31 | import org.jeecgframework.poi.excel.entity.ImportParams; | 29 | import org.jeecgframework.poi.excel.entity.ImportParams; |
32 | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | 30 | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
31 | +import org.springframework.beans.factory.annotation.Autowired; | ||
32 | +import org.springframework.web.bind.annotation.*; | ||
33 | import org.springframework.web.multipart.MultipartFile; | 33 | import org.springframework.web.multipart.MultipartFile; |
34 | import org.springframework.web.multipart.MultipartHttpServletRequest; | 34 | import org.springframework.web.multipart.MultipartHttpServletRequest; |
35 | -import java.io.IOException; | ||
36 | -import java.util.List; | ||
37 | -import java.util.Map; | ||
38 | -import java.util.stream.Collectors; | 35 | +import org.springframework.web.servlet.ModelAndView; |
36 | + | ||
37 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
38 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
39 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
40 | + | ||
41 | +import io.swagger.annotations.Api; | ||
42 | +import io.swagger.annotations.ApiOperation; | ||
43 | +import lombok.extern.slf4j.Slf4j; | ||
39 | 44 | ||
40 | /** | 45 | /** |
41 | * @Description: 库存表 | 46 | * @Description: 库存表 |
@@ -70,6 +75,8 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, | @@ -70,6 +75,8 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, | ||
70 | @GetMapping(value = "/list") | 75 | @GetMapping(value = "/list") |
71 | public Result<IPage<InventoryHeader>> queryPageList(InventoryHeader inventoryHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 76 | public Result<IPage<InventoryHeader>> queryPageList(InventoryHeader inventoryHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
72 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | 77 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
78 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
79 | + inventoryHeader.setWarehouseCode(warehouseCode); | ||
73 | QueryWrapper<InventoryHeader> queryWrapper = QueryGenerator.initQueryWrapper(inventoryHeader, req.getParameterMap()); | 80 | QueryWrapper<InventoryHeader> queryWrapper = QueryGenerator.initQueryWrapper(inventoryHeader, req.getParameterMap()); |
74 | Page<InventoryHeader> page = new Page<InventoryHeader>(pageNo, pageSize); | 81 | Page<InventoryHeader> page = new Page<InventoryHeader>(pageNo, pageSize); |
75 | IPage<InventoryHeader> pageList = inventoryHeaderService.page(page, queryWrapper); | 82 | IPage<InventoryHeader> pageList = inventoryHeaderService.page(page, queryWrapper); |
@@ -86,7 +93,9 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, | @@ -86,7 +93,9 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, | ||
86 | @PostMapping(value = "/add") | 93 | @PostMapping(value = "/add") |
87 | public Result<String> add(@RequestBody InventoryHeader inventoryHeader, HttpServletRequest req) { | 94 | public Result<String> add(@RequestBody InventoryHeader inventoryHeader, HttpServletRequest req) { |
88 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | 95 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); |
89 | - inventoryHeader.setWarehouseCode(warehouseCode); | 96 | + if (StringUtils.isNotEmpty(warehouseCode)) { |
97 | + inventoryHeader.setWarehouseCode(warehouseCode); | ||
98 | + } | ||
90 | inventoryHeaderService.save(inventoryHeader); | 99 | inventoryHeaderService.save(inventoryHeader); |
91 | return Result.OK("添加成功!"); | 100 | return Result.OK("添加成功!"); |
92 | } | 101 | } |
@@ -264,9 +273,7 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, | @@ -264,9 +273,7 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, | ||
264 | @ApiOperation(value = "库存表-有货非锁定列表查询", notes = "库存表-有货非锁定列表查询") | 273 | @ApiOperation(value = "库存表-有货非锁定列表查询", notes = "库存表-有货非锁定列表查询") |
265 | @GetMapping(value = "/freeList") | 274 | @GetMapping(value = "/freeList") |
266 | public Result<IPage<InventoryHeader>> freeList(InventoryHeader inventoryHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 275 | public Result<IPage<InventoryHeader>> freeList(InventoryHeader inventoryHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
267 | - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | ||
268 | - | ||
269 | - | 276 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
270 | 277 | ||
271 | QueryWrapper<InventoryHeader> queryWrapper = QueryGenerator.initQueryWrapper(inventoryHeader, req.getParameterMap()); | 278 | QueryWrapper<InventoryHeader> queryWrapper = QueryGenerator.initQueryWrapper(inventoryHeader, req.getParameterMap()); |
272 | queryWrapper.eq("container_status", QuantityConstant.STATUS_CONTAINER_SOME); | 279 | queryWrapper.eq("container_status", QuantityConstant.STATUS_CONTAINER_SOME); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryTransaction/controller/InventoryTransactionController.java
1 | package org.jeecg.modules.wms.inventory.inventoryTransaction.controller; | 1 | package org.jeecg.modules.wms.inventory.inventoryTransaction.controller; |
2 | 2 | ||
3 | import java.util.Arrays; | 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; | 4 | + |
10 | import javax.servlet.http.HttpServletRequest; | 5 | import javax.servlet.http.HttpServletRequest; |
11 | import javax.servlet.http.HttpServletResponse; | 6 | import javax.servlet.http.HttpServletResponse; |
7 | + | ||
12 | import org.jeecg.common.api.vo.Result; | 8 | import org.jeecg.common.api.vo.Result; |
9 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
10 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
13 | import org.jeecg.common.system.query.QueryGenerator; | 11 | import org.jeecg.common.system.query.QueryGenerator; |
12 | +import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; | ||
13 | +import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; | ||
14 | import org.jeecg.utils.HuahengJwtUtil; | 14 | import org.jeecg.utils.HuahengJwtUtil; |
15 | -import org.jeecg.common.util.oConvertUtils; | 15 | +import org.springframework.beans.factory.annotation.Autowired; |
16 | +import org.springframework.web.bind.annotation.*; | ||
17 | +import org.springframework.web.servlet.ModelAndView; | ||
16 | 18 | ||
17 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 19 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
18 | import com.baomidou.mybatisplus.core.metadata.IPage; | 20 | import com.baomidou.mybatisplus.core.metadata.IPage; |
19 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 21 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
20 | -import lombok.extern.slf4j.Slf4j; | ||
21 | 22 | ||
22 | -import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; | ||
23 | -import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; | ||
24 | -import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
25 | -import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
26 | -import org.jeecgframework.poi.excel.entity.ExportParams; | ||
27 | -import org.jeecgframework.poi.excel.entity.ImportParams; | ||
28 | -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
29 | -import org.jeecg.common.system.base.controller.JeecgController; | ||
30 | -import org.springframework.beans.factory.annotation.Autowired; | ||
31 | -import org.springframework.web.bind.annotation.*; | ||
32 | -import org.springframework.web.multipart.MultipartFile; | ||
33 | -import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
34 | -import org.springframework.web.servlet.ModelAndView; | ||
35 | -import com.alibaba.fastjson.JSON; | ||
36 | import io.swagger.annotations.Api; | 23 | import io.swagger.annotations.Api; |
37 | import io.swagger.annotations.ApiOperation; | 24 | import io.swagger.annotations.ApiOperation; |
38 | -import org.jeecg.common.aspect.annotation.AutoLog; | 25 | +import lombok.extern.slf4j.Slf4j; |
39 | 26 | ||
40 | /** | 27 | /** |
41 | * @Description: 库存交易记录 | 28 | * @Description: 库存交易记录 |
@@ -65,6 +52,8 @@ public class InventoryTransactionController extends JeecgController<InventoryTra | @@ -65,6 +52,8 @@ public class InventoryTransactionController extends JeecgController<InventoryTra | ||
65 | public Result<IPage<InventoryTransaction>> queryPageList(InventoryTransaction inventoryTransaction, | 52 | public Result<IPage<InventoryTransaction>> queryPageList(InventoryTransaction inventoryTransaction, |
66 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | 53 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
67 | HttpServletRequest req) { | 54 | HttpServletRequest req) { |
55 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
56 | + inventoryTransaction.setWarehouseCode(warehouseCode); | ||
68 | QueryWrapper<InventoryTransaction> queryWrapper = QueryGenerator.initQueryWrapper(inventoryTransaction, req.getParameterMap()); | 57 | QueryWrapper<InventoryTransaction> queryWrapper = QueryGenerator.initQueryWrapper(inventoryTransaction, req.getParameterMap()); |
69 | Page<InventoryTransaction> page = new Page<InventoryTransaction>(pageNo, pageSize); | 58 | Page<InventoryTransaction> page = new Page<InventoryTransaction>(pageNo, pageSize); |
70 | IPage<InventoryTransaction> pageList = inventoryTransactionService.page(page, queryWrapper); | 59 | IPage<InventoryTransaction> pageList = inventoryTransactionService.page(page, queryWrapper); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/controller/ApiLogController.java
1 | package org.jeecg.modules.wms.monitor.apiLog.controller; | 1 | package org.jeecg.modules.wms.monitor.apiLog.controller; |
2 | 2 | ||
3 | import java.util.Arrays; | 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; | 4 | + |
10 | import javax.servlet.http.HttpServletRequest; | 5 | import javax.servlet.http.HttpServletRequest; |
11 | import javax.servlet.http.HttpServletResponse; | 6 | import javax.servlet.http.HttpServletResponse; |
7 | + | ||
12 | import org.jeecg.common.api.vo.Result; | 8 | import org.jeecg.common.api.vo.Result; |
9 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
10 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
13 | import org.jeecg.common.system.query.QueryGenerator; | 11 | import org.jeecg.common.system.query.QueryGenerator; |
14 | -import org.jeecg.common.util.oConvertUtils; | ||
15 | - | ||
16 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
17 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
18 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
19 | -import lombok.extern.slf4j.Slf4j; | ||
20 | - | ||
21 | import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog; | 12 | import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog; |
22 | import org.jeecg.modules.wms.monitor.apiLog.service.IApiLogService; | 13 | import org.jeecg.modules.wms.monitor.apiLog.service.IApiLogService; |
23 | -import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
24 | -import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
25 | -import org.jeecgframework.poi.excel.entity.ExportParams; | ||
26 | -import org.jeecgframework.poi.excel.entity.ImportParams; | ||
27 | -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
28 | -import org.jeecg.common.system.base.controller.JeecgController; | ||
29 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
30 | import org.springframework.web.bind.annotation.*; | 15 | import org.springframework.web.bind.annotation.*; |
31 | -import org.springframework.web.multipart.MultipartFile; | ||
32 | -import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
33 | import org.springframework.web.servlet.ModelAndView; | 16 | import org.springframework.web.servlet.ModelAndView; |
34 | -import com.alibaba.fastjson.JSON; | 17 | + |
18 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
19 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
20 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
21 | + | ||
35 | import io.swagger.annotations.Api; | 22 | import io.swagger.annotations.Api; |
36 | import io.swagger.annotations.ApiOperation; | 23 | import io.swagger.annotations.ApiOperation; |
37 | -import org.jeecg.common.aspect.annotation.AutoLog; | 24 | +import lombok.extern.slf4j.Slf4j; |
38 | 25 | ||
39 | /** | 26 | /** |
40 | * @Description: 接口日志 | 27 | * @Description: 接口日志 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
@@ -91,6 +91,8 @@ public class ReceiptContainerHeaderController extends JeecgController<ReceiptCon | @@ -91,6 +91,8 @@ public class ReceiptContainerHeaderController extends JeecgController<ReceiptCon | ||
91 | public Result<IPage<ReceiptContainerHeader>> queryPageList(ReceiptContainerHeader receiptContainerHeader, | 91 | public Result<IPage<ReceiptContainerHeader>> queryPageList(ReceiptContainerHeader receiptContainerHeader, |
92 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | 92 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
93 | HttpServletRequest req) { | 93 | HttpServletRequest req) { |
94 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
95 | + receiptContainerHeader.setWarehouseCode(warehouseCode); | ||
94 | QueryWrapper<ReceiptContainerHeader> queryWrapper = QueryGenerator.initQueryWrapper(receiptContainerHeader, req.getParameterMap()); | 96 | QueryWrapper<ReceiptContainerHeader> queryWrapper = QueryGenerator.initQueryWrapper(receiptContainerHeader, req.getParameterMap()); |
95 | Page<ReceiptContainerHeader> page = new Page<ReceiptContainerHeader>(pageNo, pageSize); | 97 | Page<ReceiptContainerHeader> page = new Page<ReceiptContainerHeader>(pageNo, pageSize); |
96 | IPage<ReceiptContainerHeader> pageList = receiptContainerHeaderService.page(page, queryWrapper); | 98 | IPage<ReceiptContainerHeader> pageList = receiptContainerHeaderService.page(page, queryWrapper); |
@@ -106,7 +108,11 @@ public class ReceiptContainerHeaderController extends JeecgController<ReceiptCon | @@ -106,7 +108,11 @@ public class ReceiptContainerHeaderController extends JeecgController<ReceiptCon | ||
106 | @ApiOperation(value = "入库组盘-添加", notes = "入库组盘-添加") | 108 | @ApiOperation(value = "入库组盘-添加", notes = "入库组盘-添加") |
107 | @RequiresPermissions("receiptContainerHeader:add") | 109 | @RequiresPermissions("receiptContainerHeader:add") |
108 | @PostMapping(value = "/add") | 110 | @PostMapping(value = "/add") |
109 | - public Result<String> add(@RequestBody ReceiptContainerHeader receiptContainerHeader) { | 111 | + public Result<String> add(@RequestBody ReceiptContainerHeader receiptContainerHeader, HttpServletRequest req) { |
112 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
113 | + if (StringUtils.isNotEmpty(warehouseCode)) { | ||
114 | + receiptContainerHeader.setWarehouseCode(warehouseCode); | ||
115 | + } | ||
110 | receiptContainerHeaderService.save(receiptContainerHeader); | 116 | receiptContainerHeaderService.save(receiptContainerHeader); |
111 | return Result.OK("添加成功!"); | 117 | return Result.OK("添加成功!"); |
112 | } | 118 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/controller/ReceiptHeaderController.java
@@ -96,6 +96,8 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | @@ -96,6 +96,8 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | ||
96 | @GetMapping(value = "/list") | 96 | @GetMapping(value = "/list") |
97 | public Result<IPage<ReceiptHeader>> queryPageList(ReceiptHeader receiptHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 97 | public Result<IPage<ReceiptHeader>> queryPageList(ReceiptHeader receiptHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
98 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | 98 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
99 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
100 | + receiptHeader.setWarehouseCode(warehouseCode); | ||
99 | QueryWrapper<ReceiptHeader> queryWrapper = QueryGenerator.initQueryWrapper(receiptHeader, req.getParameterMap()); | 101 | QueryWrapper<ReceiptHeader> queryWrapper = QueryGenerator.initQueryWrapper(receiptHeader, req.getParameterMap()); |
100 | Page<ReceiptHeader> page = new Page<ReceiptHeader>(pageNo, pageSize); | 102 | Page<ReceiptHeader> page = new Page<ReceiptHeader>(pageNo, pageSize); |
101 | IPage<ReceiptHeader> pageList = receiptHeaderService.page(page, queryWrapper); | 103 | IPage<ReceiptHeader> pageList = receiptHeaderService.page(page, queryWrapper); |
@@ -210,9 +212,8 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | @@ -210,9 +212,8 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | ||
210 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | 212 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
211 | LambdaQueryWrapper<ReceiptDetail> query = Wrappers.lambdaQuery(); | 213 | LambdaQueryWrapper<ReceiptDetail> query = Wrappers.lambdaQuery(); |
212 | query.eq(StringUtils.isNotEmpty(code), ReceiptDetail::getReceiptCode, code) | 214 | query.eq(StringUtils.isNotEmpty(code), ReceiptDetail::getReceiptCode, code) |
213 | - .eq(StringUtils.isNotEmpty(materialCode), ReceiptDetail::getMaterialCode, materialCode) | ||
214 | - .lt(ReceiptDetail::getStatus, QuantityConstant.RECEIPT_HEADER_COMPLETED) | ||
215 | - .last(" and qty-task_qty>0"); | 215 | + .eq(StringUtils.isNotEmpty(materialCode), ReceiptDetail::getMaterialCode, materialCode) |
216 | + .lt(ReceiptDetail::getStatus, QuantityConstant.RECEIPT_HEADER_COMPLETED).last(" and qty-task_qty>0"); | ||
216 | Page<ReceiptDetail> page = new Page<ReceiptDetail>(pageNo, pageSize); | 217 | Page<ReceiptDetail> page = new Page<ReceiptDetail>(pageNo, pageSize); |
217 | IPage<ReceiptDetail> pageList = receiptDetailService.page(page, query); | 218 | IPage<ReceiptDetail> pageList = receiptDetailService.page(page, query); |
218 | return Result.ok(pageList); | 219 | return Result.ok(pageList); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java
1 | package org.jeecg.modules.wms.shipment.shipmentCombination.controller; | 1 | package org.jeecg.modules.wms.shipment.shipmentCombination.controller; |
2 | 2 | ||
3 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
5 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
6 | -import io.swagger.annotations.Api; | ||
7 | -import io.swagger.annotations.ApiOperation; | ||
8 | -import io.swagger.models.auth.In; | ||
9 | -import lombok.extern.slf4j.Slf4j; | 3 | +import java.math.BigDecimal; |
4 | +import java.util.List; | ||
5 | + | ||
6 | +import javax.annotation.Resource; | ||
7 | +import javax.servlet.http.HttpServletRequest; | ||
8 | + | ||
10 | import org.jeecg.common.api.vo.Result; | 9 | import org.jeecg.common.api.vo.Result; |
11 | import org.jeecg.common.aspect.annotation.AutoLog; | 10 | import org.jeecg.common.aspect.annotation.AutoLog; |
12 | -import org.jeecg.common.system.query.QueryGenerator; | ||
13 | -import org.jeecg.utils.HuahengJwtUtil; | ||
14 | import org.jeecg.modules.wms.config.location.entity.Location; | 11 | import org.jeecg.modules.wms.config.location.entity.Location; |
15 | import org.jeecg.modules.wms.config.location.service.ILocationService; | 12 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
16 | import org.jeecg.modules.wms.config.port.entity.Port; | 13 | import org.jeecg.modules.wms.config.port.entity.Port; |
@@ -19,10 +16,6 @@ import org.jeecg.modules.wms.config.zone.entity.Zone; | @@ -19,10 +16,6 @@ import org.jeecg.modules.wms.config.zone.entity.Zone; | ||
19 | import org.jeecg.modules.wms.config.zone.service.IZoneService; | 16 | import org.jeecg.modules.wms.config.zone.service.IZoneService; |
20 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 17 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
21 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 18 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
22 | -import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; | ||
23 | -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; | ||
24 | -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; | ||
25 | -import org.jeecg.modules.wms.receipt.receiving.domain.Receive; | ||
26 | import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel; | 19 | import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel; |
27 | import org.jeecg.modules.wms.shipment.shipmentCombination.entity.Shipment; | 20 | import org.jeecg.modules.wms.shipment.shipmentCombination.entity.Shipment; |
28 | import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; | 21 | import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; |
@@ -31,15 +24,17 @@ import org.jeecg.modules.wms.shipment.shipmentHeader.entity.CombinationParam; | @@ -31,15 +24,17 @@ import org.jeecg.modules.wms.shipment.shipmentHeader.entity.CombinationParam; | ||
31 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; | 24 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; |
32 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; | 25 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; |
33 | import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService; | 26 | import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService; |
27 | +import org.jeecg.utils.HuahengJwtUtil; | ||
34 | import org.jeecg.utils.StringUtils; | 28 | import org.jeecg.utils.StringUtils; |
35 | import org.jeecg.utils.constant.QuantityConstant; | 29 | import org.jeecg.utils.constant.QuantityConstant; |
36 | import org.springframework.web.bind.annotation.*; | 30 | import org.springframework.web.bind.annotation.*; |
37 | 31 | ||
38 | -import javax.annotation.Resource; | ||
39 | -import javax.servlet.http.HttpServletRequest; | ||
40 | -import java.math.BigDecimal; | ||
41 | -import java.util.ArrayList; | ||
42 | -import java.util.List; | 32 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
33 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
34 | + | ||
35 | +import io.swagger.annotations.Api; | ||
36 | +import io.swagger.annotations.ApiOperation; | ||
37 | +import lombok.extern.slf4j.Slf4j; | ||
43 | 38 | ||
44 | /** | 39 | /** |
45 | * @author 游杰 | 40 | * @author 游杰 |
@@ -72,7 +67,7 @@ public class ShipmentCombinationController { | @@ -72,7 +67,7 @@ public class ShipmentCombinationController { | ||
72 | @ResponseBody | 67 | @ResponseBody |
73 | public Result getShipmentDetailListByShipmentCode(String shipmentCode, HttpServletRequest req) { | 68 | public Result getShipmentDetailListByShipmentCode(String shipmentCode, HttpServletRequest req) { |
74 | if (StringUtils.isEmpty(shipmentCode)) { | 69 | if (StringUtils.isEmpty(shipmentCode)) { |
75 | - return null; | 70 | + return Result.error("没有找到出库单号"); |
76 | } | 71 | } |
77 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | 72 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); |
78 | LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | 73 | LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/controller/ShipmentContainerHeaderController.java
@@ -21,6 +21,8 @@ import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentCon | @@ -21,6 +21,8 @@ import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentCon | ||
21 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; | 21 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; |
22 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService; | 22 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService; |
23 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; | 23 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; |
24 | +import org.jeecg.utils.HuahengJwtUtil; | ||
25 | +import org.jeecg.utils.StringUtils; | ||
24 | import org.jeecgframework.poi.excel.ExcelImportUtil; | 26 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
25 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; | 27 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
26 | import org.jeecgframework.poi.excel.entity.ExportParams; | 28 | import org.jeecgframework.poi.excel.entity.ExportParams; |
@@ -74,6 +76,8 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | @@ -74,6 +76,8 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | ||
74 | public Result<IPage<ShipmentContainerHeader>> queryPageList(ShipmentContainerHeader shipmentContainerHeader, | 76 | public Result<IPage<ShipmentContainerHeader>> queryPageList(ShipmentContainerHeader shipmentContainerHeader, |
75 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | 77 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
76 | HttpServletRequest req) { | 78 | HttpServletRequest req) { |
79 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
80 | + shipmentContainerHeader.setWarehouseCode(warehouseCode); | ||
77 | QueryWrapper<ShipmentContainerHeader> queryWrapper = QueryGenerator.initQueryWrapper(shipmentContainerHeader, req.getParameterMap()); | 81 | QueryWrapper<ShipmentContainerHeader> queryWrapper = QueryGenerator.initQueryWrapper(shipmentContainerHeader, req.getParameterMap()); |
78 | Page<ShipmentContainerHeader> page = new Page<ShipmentContainerHeader>(pageNo, pageSize); | 82 | Page<ShipmentContainerHeader> page = new Page<ShipmentContainerHeader>(pageNo, pageSize); |
79 | IPage<ShipmentContainerHeader> pageList = shipmentContainerHeaderService.page(page, queryWrapper); | 83 | IPage<ShipmentContainerHeader> pageList = shipmentContainerHeaderService.page(page, queryWrapper); |
@@ -89,7 +93,11 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | @@ -89,7 +93,11 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | ||
89 | @ApiOperation(value = "出库组盘-添加", notes = "出库组盘-添加") | 93 | @ApiOperation(value = "出库组盘-添加", notes = "出库组盘-添加") |
90 | @PostMapping(value = "/add") | 94 | @PostMapping(value = "/add") |
91 | @RequiresPermissions("shipmentContainerHeader:add") | 95 | @RequiresPermissions("shipmentContainerHeader:add") |
92 | - public Result<String> add(@RequestBody ShipmentContainerHeader shipmentContainerHeader) { | 96 | + public Result<String> add(@RequestBody ShipmentContainerHeader shipmentContainerHeader, HttpServletRequest req) { |
97 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
98 | + if (StringUtils.isNotEmpty(warehouseCode)) { | ||
99 | + shipmentContainerHeader.setWarehouseCode(warehouseCode); | ||
100 | + } | ||
93 | shipmentContainerHeaderService.save(shipmentContainerHeader); | 101 | shipmentContainerHeaderService.save(shipmentContainerHeader); |
94 | return Result.OK("添加成功!"); | 102 | return Result.OK("添加成功!"); |
95 | } | 103 | } |
@@ -166,6 +174,8 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | @@ -166,6 +174,8 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | ||
166 | public Result<IPage<ShipmentContainerDetail>> listShipmentContainerDetailByMainId(ShipmentContainerDetail shipmentContainerDetail, | 174 | public Result<IPage<ShipmentContainerDetail>> listShipmentContainerDetailByMainId(ShipmentContainerDetail shipmentContainerDetail, |
167 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | 175 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
168 | HttpServletRequest req) { | 176 | HttpServletRequest req) { |
177 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
178 | + shipmentContainerDetail.setWarehouseCode(warehouseCode); | ||
169 | QueryWrapper<ShipmentContainerDetail> queryWrapper = QueryGenerator.initQueryWrapper(shipmentContainerDetail, req.getParameterMap()); | 179 | QueryWrapper<ShipmentContainerDetail> queryWrapper = QueryGenerator.initQueryWrapper(shipmentContainerDetail, req.getParameterMap()); |
170 | Page<ShipmentContainerDetail> page = new Page<ShipmentContainerDetail>(pageNo, pageSize); | 180 | Page<ShipmentContainerDetail> page = new Page<ShipmentContainerDetail>(pageNo, pageSize); |
171 | IPage<ShipmentContainerDetail> pageList = shipmentContainerDetailService.page(page, queryWrapper); | 181 | IPage<ShipmentContainerDetail> pageList = shipmentContainerDetailService.page(page, queryWrapper); |
@@ -181,7 +191,11 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | @@ -181,7 +191,11 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | ||
181 | @ApiOperation(value = "出库组盘详情-添加", notes = "出库组盘详情-添加") | 191 | @ApiOperation(value = "出库组盘详情-添加", notes = "出库组盘详情-添加") |
182 | @RequiresPermissions("shipmentContainerDetail:add") | 192 | @RequiresPermissions("shipmentContainerDetail:add") |
183 | @PostMapping(value = "/addShipmentContainerDetail") | 193 | @PostMapping(value = "/addShipmentContainerDetail") |
184 | - public Result<String> addShipmentContainerDetail(@RequestBody ShipmentContainerDetail shipmentContainerDetail) { | 194 | + public Result<String> addShipmentContainerDetail(@RequestBody ShipmentContainerDetail shipmentContainerDetail, HttpServletRequest req) { |
195 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
196 | + if (StringUtils.isEmpty(warehouseCode)) { | ||
197 | + shipmentContainerDetail.setWarehouseCode(warehouseCode); | ||
198 | + } | ||
185 | shipmentContainerDetailService.save(shipmentContainerDetail); | 199 | shipmentContainerDetailService.save(shipmentContainerDetail); |
186 | return Result.OK("添加成功!"); | 200 | return Result.OK("添加成功!"); |
187 | } | 201 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeaderHistory/controller/ShipmentHeaderHistoryController.java
1 | package org.jeecg.modules.wms.shipment.shipmentHeaderHistory.controller; | 1 | package org.jeecg.modules.wms.shipment.shipmentHeaderHistory.controller; |
2 | 2 | ||
3 | -import org.jeecg.common.system.query.QueryGenerator; | ||
4 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
5 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
6 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
7 | -import lombok.extern.slf4j.Slf4j; | ||
8 | -import org.jeecg.common.system.base.controller.JeecgController; | ||
9 | -import org.jeecg.common.api.vo.Result; | ||
10 | -import org.springframework.beans.factory.annotation.Autowired; | ||
11 | -import org.springframework.web.bind.annotation.*; | ||
12 | -import javax.servlet.http.HttpServletRequest; | ||
13 | import java.util.Arrays; | 3 | import java.util.Arrays; |
14 | -import org.jeecg.common.util.oConvertUtils; | 4 | + |
5 | +import javax.servlet.http.HttpServletRequest; | ||
6 | + | ||
7 | +import org.jeecg.common.api.vo.Result; | ||
8 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
9 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
10 | +import org.jeecg.common.system.query.QueryGenerator; | ||
15 | import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentDetailHistory; | 11 | import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentDetailHistory; |
16 | import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentHeaderHistory; | 12 | import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentHeaderHistory; |
17 | -import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.IShipmentHeaderHistoryService; | ||
18 | import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.IShipmentDetailHistoryService; | 13 | import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.IShipmentDetailHistoryService; |
14 | +import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.IShipmentHeaderHistoryService; | ||
15 | +import org.jeecg.utils.HuahengJwtUtil; | ||
16 | +import org.springframework.beans.factory.annotation.Autowired; | ||
17 | +import org.springframework.web.bind.annotation.*; | ||
18 | + | ||
19 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
20 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
21 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
22 | + | ||
19 | import io.swagger.annotations.Api; | 23 | import io.swagger.annotations.Api; |
20 | import io.swagger.annotations.ApiOperation; | 24 | import io.swagger.annotations.ApiOperation; |
21 | -import org.jeecg.common.aspect.annotation.AutoLog; | 25 | +import lombok.extern.slf4j.Slf4j; |
22 | 26 | ||
23 | /** | 27 | /** |
24 | * @Description: 历史出库单 | 28 | * @Description: 历史出库单 |
@@ -54,6 +58,8 @@ public class ShipmentHeaderHistoryController extends JeecgController<ShipmentHea | @@ -54,6 +58,8 @@ public class ShipmentHeaderHistoryController extends JeecgController<ShipmentHea | ||
54 | public Result<IPage<ShipmentHeaderHistory>> queryPageList(ShipmentHeaderHistory shipmentHeaderHistory, | 58 | public Result<IPage<ShipmentHeaderHistory>> queryPageList(ShipmentHeaderHistory shipmentHeaderHistory, |
55 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | 59 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
56 | HttpServletRequest req) { | 60 | HttpServletRequest req) { |
61 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
62 | + shipmentHeaderHistory.setWarehouseCode(warehouseCode); | ||
57 | QueryWrapper<ShipmentHeaderHistory> queryWrapper = QueryGenerator.initQueryWrapper(shipmentHeaderHistory, req.getParameterMap()); | 63 | QueryWrapper<ShipmentHeaderHistory> queryWrapper = QueryGenerator.initQueryWrapper(shipmentHeaderHistory, req.getParameterMap()); |
58 | Page<ShipmentHeaderHistory> page = new Page<>(pageNo, pageSize); | 64 | Page<ShipmentHeaderHistory> page = new Page<>(pageNo, pageSize); |
59 | IPage<ShipmentHeaderHistory> pageList = shipmentHeaderHistoryService.page(page, queryWrapper); | 65 | IPage<ShipmentHeaderHistory> pageList = shipmentHeaderHistoryService.page(page, queryWrapper); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java
1 | package org.jeecg.modules.wms.stocktaking.cycleCountDetail.controller; | 1 | package org.jeecg.modules.wms.stocktaking.cycleCountDetail.controller; |
2 | 2 | ||
3 | -import java.io.UnsupportedEncodingException; | ||
4 | import java.io.IOException; | 3 | import java.io.IOException; |
5 | -import java.math.BigDecimal; | ||
6 | -import java.net.URLDecoder; | ||
7 | import java.util.ArrayList; | 4 | import java.util.ArrayList; |
8 | import java.util.Arrays; | 5 | import java.util.Arrays; |
9 | import java.util.List; | 6 | import java.util.List; |
@@ -12,9 +9,14 @@ import java.util.stream.Collectors; | @@ -12,9 +9,14 @@ import java.util.stream.Collectors; | ||
12 | 9 | ||
13 | import javax.annotation.Resource; | 10 | import javax.annotation.Resource; |
14 | import javax.servlet.http.HttpServletRequest; | 11 | import javax.servlet.http.HttpServletRequest; |
12 | +import javax.servlet.http.HttpServletResponse; | ||
15 | 13 | ||
16 | -import org.apache.shiro.authz.annotation.RequiresPermissions; | ||
17 | -import org.jeecg.modules.system.entity.SysAnnouncementSend; | 14 | +import org.apache.shiro.SecurityUtils; |
15 | +import org.jeecg.common.api.vo.Result; | ||
16 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
17 | +import org.jeecg.common.system.query.QueryGenerator; | ||
18 | +import org.jeecg.common.system.vo.LoginUser; | ||
19 | +import org.jeecg.common.util.oConvertUtils; | ||
18 | import org.jeecg.modules.wms.config.location.entity.Location; | 20 | import org.jeecg.modules.wms.config.location.entity.Location; |
19 | import org.jeecg.modules.wms.config.location.service.impl.LocationServiceImpl; | 21 | import org.jeecg.modules.wms.config.location.service.impl.LocationServiceImpl; |
20 | import org.jeecg.modules.wms.config.port.entity.Port; | 22 | import org.jeecg.modules.wms.config.port.entity.Port; |
@@ -22,15 +24,12 @@ import org.jeecg.modules.wms.config.port.service.impl.PortServiceImpl; | @@ -22,15 +24,12 @@ import org.jeecg.modules.wms.config.port.service.impl.PortServiceImpl; | ||
22 | import org.jeecg.modules.wms.config.zone.entity.Zone; | 24 | import org.jeecg.modules.wms.config.zone.entity.Zone; |
23 | import org.jeecg.modules.wms.config.zone.service.impl.ZoneServiceImpl; | 25 | import org.jeecg.modules.wms.config.zone.service.impl.ZoneServiceImpl; |
24 | import org.jeecg.modules.wms.framework.controller.HuahengBaseController; | 26 | import org.jeecg.modules.wms.framework.controller.HuahengBaseController; |
25 | -import javax.servlet.http.HttpServletResponse; | ||
26 | - | ||
27 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
28 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
29 | - | ||
30 | -import org.jeecg.modules.wms.framework.controller.HuahengBaseController; | ||
31 | -import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | ||
32 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 27 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
33 | -import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; | 28 | +import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail; |
29 | +import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild; | ||
30 | +import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.ICycleCountDetailChildService; | ||
31 | +import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.ICycleCountDetailService; | ||
32 | +import org.jeecg.modules.wms.stocktaking.cycleCountDetail.vo.CycleCountDetailPage; | ||
34 | import org.jeecg.utils.ConvertUtils; | 33 | import org.jeecg.utils.ConvertUtils; |
35 | import org.jeecg.utils.HuahengJwtUtil; | 34 | import org.jeecg.utils.HuahengJwtUtil; |
36 | import org.jeecg.utils.StringUtils; | 35 | import org.jeecg.utils.StringUtils; |
@@ -40,349 +39,324 @@ import org.jeecgframework.poi.excel.def.NormalExcelConstants; | @@ -40,349 +39,324 @@ import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
40 | import org.jeecgframework.poi.excel.entity.ExportParams; | 39 | import org.jeecgframework.poi.excel.entity.ExportParams; |
41 | import org.jeecgframework.poi.excel.entity.ImportParams; | 40 | import org.jeecgframework.poi.excel.entity.ImportParams; |
42 | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | 41 | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
43 | -import org.jeecg.common.system.vo.LoginUser; | ||
44 | -import org.apache.shiro.SecurityUtils; | ||
45 | -import org.jeecg.common.api.vo.Result; | ||
46 | -import org.jeecg.common.system.query.QueryGenerator; | ||
47 | -import org.jeecg.common.util.oConvertUtils; | ||
48 | -import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild; | ||
49 | -import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail; | ||
50 | -import org.jeecg.modules.wms.stocktaking.cycleCountDetail.vo.CycleCountDetailPage; | ||
51 | -import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.ICycleCountDetailService; | ||
52 | -import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.ICycleCountDetailChildService; | ||
53 | import org.springframework.beans.BeanUtils; | 42 | import org.springframework.beans.BeanUtils; |
54 | import org.springframework.beans.factory.annotation.Autowired; | 43 | import org.springframework.beans.factory.annotation.Autowired; |
55 | import org.springframework.web.bind.annotation.*; | 44 | import org.springframework.web.bind.annotation.*; |
56 | -import org.springframework.web.servlet.ModelAndView; | ||
57 | import org.springframework.web.multipart.MultipartFile; | 45 | import org.springframework.web.multipart.MultipartFile; |
58 | import org.springframework.web.multipart.MultipartHttpServletRequest; | 46 | import org.springframework.web.multipart.MultipartHttpServletRequest; |
47 | +import org.springframework.web.servlet.ModelAndView; | ||
48 | + | ||
49 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
59 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 50 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
60 | import com.baomidou.mybatisplus.core.metadata.IPage; | 51 | import com.baomidou.mybatisplus.core.metadata.IPage; |
52 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
61 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 53 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
62 | -import lombok.extern.slf4j.Slf4j; | ||
63 | -import com.alibaba.fastjson.JSON; | 54 | + |
64 | import io.swagger.annotations.Api; | 55 | import io.swagger.annotations.Api; |
65 | import io.swagger.annotations.ApiOperation; | 56 | import io.swagger.annotations.ApiOperation; |
66 | -import org.jeecg.common.aspect.annotation.AutoLog; | 57 | +import lombok.extern.slf4j.Slf4j; |
67 | 58 | ||
68 | - /** | 59 | +/** |
69 | * @Description: 盘点明细表 | 60 | * @Description: 盘点明细表 |
70 | - * @Author: jeecg-boot | ||
71 | - * @Date: 2023-01-30 | ||
72 | - * @Version: V1.0 | 61 | + * @Author: jeecg-boot |
62 | + * @Date: 2023-01-30 | ||
63 | + * @Version: V1.0 | ||
73 | */ | 64 | */ |
74 | -@Api(tags="盘点明细表") | 65 | +@Api(tags = "盘点明细表") |
75 | @RestController | 66 | @RestController |
76 | @RequestMapping("/cycleCountDetail/cycleCountDetail") | 67 | @RequestMapping("/cycleCountDetail/cycleCountDetail") |
77 | @Slf4j | 68 | @Slf4j |
78 | -public class CycleCountDetailController extends HuahengBaseController { | ||
79 | - @Autowired | ||
80 | - private ICycleCountDetailService cycleCountDetailService; | ||
81 | - @Autowired | ||
82 | - private ICycleCountDetailChildService cycleCountDetailChildService; | ||
83 | - @Autowired | ||
84 | - private IInventoryDetailService inventoryDetailService; | ||
85 | - @Resource | ||
86 | - private LocationServiceImpl locationService; | ||
87 | - @Resource | ||
88 | - private ZoneServiceImpl zoneService; | ||
89 | - @Resource | ||
90 | - private PortServiceImpl portService; | ||
91 | - | ||
92 | - /** | ||
93 | - * 分页列表查询 | ||
94 | - * | ||
95 | - * @param cycleCountDetail | ||
96 | - * @param pageNo | ||
97 | - * @param pageSize | ||
98 | - * @param req | ||
99 | - * @return | ||
100 | - */ | ||
101 | - //@AutoLog(value = "盘点明细表-分页列表查询") | ||
102 | - @ApiOperation(value="盘点明细表-分页列表查询", notes="盘点明细表-分页列表查询") | ||
103 | - @GetMapping(value = "/list") | ||
104 | - public Result<IPage<CycleCountDetail>> queryPageList(CycleCountDetail cycleCountDetail, | ||
105 | - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
106 | - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
107 | - HttpServletRequest req) { | ||
108 | - | ||
109 | - | ||
110 | - LambdaQueryWrapper<CycleCountDetail> queryWrapper = new LambdaQueryWrapper<CycleCountDetail>(); | ||
111 | - queryWrapper.eq(CycleCountDetail::getCycleCountHeadId,cycleCountDetail.getCycleCountHeadId()); | ||
112 | - Page<CycleCountDetail> page = new Page<CycleCountDetail>(pageNo, pageSize); | ||
113 | - IPage<CycleCountDetail> pageList = cycleCountDetailService.page(page, queryWrapper); | ||
114 | - return Result.OK(pageList); | ||
115 | - } | ||
116 | - | ||
117 | - /** | ||
118 | - * 添加 | ||
119 | - * | ||
120 | - * @param cycleCountDetailPage | ||
121 | - * @return | ||
122 | - */ | ||
123 | - @AutoLog(value = "盘点明细表-添加") | ||
124 | - @ApiOperation(value="盘点明细表-添加", notes="盘点明细表-添加") | ||
125 | - @PostMapping(value = "/add") | ||
126 | - public Result<String> add(@RequestBody CycleCountDetailPage cycleCountDetailPage) { | ||
127 | - CycleCountDetail cycleCountDetail = new CycleCountDetail(); | ||
128 | - BeanUtils.copyProperties(cycleCountDetailPage, cycleCountDetail); | ||
129 | - cycleCountDetailService.saveMain(cycleCountDetail, cycleCountDetailPage.getCycleCountDetailChildList()); | ||
130 | - return Result.OK("添加成功!"); | ||
131 | - } | ||
132 | - | ||
133 | - /** | ||
134 | - * 盘盈增加明细 | ||
135 | - * | ||
136 | - * @param | ||
137 | - * @return | ||
138 | - */ | ||
139 | - @AutoLog(value = "盘点盘盈-增加明细") | ||
140 | - @ApiOperation(value="盘点盘盈-增加明细", notes="盘点盘盈-增加明细") | ||
141 | - @RequestMapping(value = "/increaseInInventoryGain", method = {RequestMethod.PUT,RequestMethod.POST}) | ||
142 | - public Result<String> increaseInInventoryGain(@RequestBody CycleCountDetailChild cycleCountDetailChild) { | ||
143 | - return cycleCountDetailService.increaseInInventoryGain(cycleCountDetailChild); | ||
144 | - } | ||
145 | - | ||
146 | - /** | ||
147 | - * 通过id删除 | ||
148 | - * | ||
149 | - * @param id | ||
150 | - * @return | ||
151 | - */ | ||
152 | - @AutoLog(value = "盘点明细表-通过id删除") | ||
153 | - @ApiOperation(value="盘点明细表-通过id删除", notes="盘点明细表-通过id删除") | ||
154 | - @DeleteMapping(value = "/delete") | ||
155 | - public Result<String> delete(@RequestParam(name="id",required=true) String id) { | ||
156 | - cycleCountDetailService.delMain(id); | ||
157 | - return Result.OK("删除成功!"); | ||
158 | - } | ||
159 | - | ||
160 | - /** | ||
161 | - * 批量删除 | ||
162 | - * | ||
163 | - * @param ids | ||
164 | - * @return | ||
165 | - */ | ||
166 | - @AutoLog(value = "盘点明细表-批量删除") | ||
167 | - @ApiOperation(value="盘点明细表-批量删除", notes="盘点明细表-批量删除") | ||
168 | - @DeleteMapping(value = "/deleteBatch") | ||
169 | - public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | ||
170 | - this.cycleCountDetailService.delBatchMain(Arrays.asList(ids.split(","))); | ||
171 | - return Result.OK("批量删除成功!"); | ||
172 | - } | 69 | +public class CycleCountDetailController extends HuahengBaseController { |
70 | + @Autowired | ||
71 | + private ICycleCountDetailService cycleCountDetailService; | ||
72 | + @Autowired | ||
73 | + private ICycleCountDetailChildService cycleCountDetailChildService; | ||
74 | + @Autowired | ||
75 | + private IInventoryDetailService inventoryDetailService; | ||
76 | + @Resource | ||
77 | + private LocationServiceImpl locationService; | ||
78 | + @Resource | ||
79 | + private ZoneServiceImpl zoneService; | ||
80 | + @Resource | ||
81 | + private PortServiceImpl portService; | ||
173 | 82 | ||
174 | - /** | ||
175 | - * 通过id查询 | ||
176 | - * | ||
177 | - * @param id | ||
178 | - * @return | ||
179 | - */ | ||
180 | - //@AutoLog(value = "盘点明细表-通过id查询") | ||
181 | - @ApiOperation(value="盘点明细表-通过id查询", notes="盘点明细表-通过id查询") | ||
182 | - @GetMapping(value = "/queryById") | ||
183 | - public Result<CycleCountDetail> queryById(@RequestParam(name="id",required=true) String id) { | ||
184 | - CycleCountDetail cycleCountDetail = cycleCountDetailService.getById(id); | ||
185 | - if(cycleCountDetail==null) { | ||
186 | - return Result.error("未找到对应数据"); | ||
187 | - } | ||
188 | - return Result.OK(cycleCountDetail); | 83 | + /** |
84 | + * 分页列表查询 | ||
85 | + * @param cycleCountDetail | ||
86 | + * @param pageNo | ||
87 | + * @param pageSize | ||
88 | + * @param req | ||
89 | + * @return | ||
90 | + */ | ||
91 | + // @AutoLog(value = "盘点明细表-分页列表查询") | ||
92 | + @ApiOperation(value = "盘点明细表-分页列表查询", notes = "盘点明细表-分页列表查询") | ||
93 | + @GetMapping(value = "/list") | ||
94 | + public Result<IPage<CycleCountDetail>> queryPageList(CycleCountDetail cycleCountDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||
95 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | ||
96 | + LambdaQueryWrapper<CycleCountDetail> queryWrapper = new LambdaQueryWrapper<CycleCountDetail>(); | ||
97 | + queryWrapper.eq(CycleCountDetail::getCycleCountHeadId, cycleCountDetail.getCycleCountHeadId()); | ||
98 | + Page<CycleCountDetail> page = new Page<CycleCountDetail>(pageNo, pageSize); | ||
99 | + IPage<CycleCountDetail> pageList = cycleCountDetailService.page(page, queryWrapper); | ||
100 | + return Result.OK(pageList); | ||
101 | + } | ||
189 | 102 | ||
190 | - } | 103 | + /** |
104 | + * 添加 | ||
105 | + * @param cycleCountDetailPage | ||
106 | + * @return | ||
107 | + */ | ||
108 | + @AutoLog(value = "盘点明细表-添加") | ||
109 | + @ApiOperation(value = "盘点明细表-添加", notes = "盘点明细表-添加") | ||
110 | + @PostMapping(value = "/add") | ||
111 | + public Result<String> add(@RequestBody CycleCountDetailPage cycleCountDetailPage) { | ||
112 | + CycleCountDetail cycleCountDetail = new CycleCountDetail(); | ||
113 | + BeanUtils.copyProperties(cycleCountDetailPage, cycleCountDetail); | ||
114 | + cycleCountDetailService.saveMain(cycleCountDetail, cycleCountDetailPage.getCycleCountDetailChildList()); | ||
115 | + return Result.OK("添加成功!"); | ||
116 | + } | ||
191 | 117 | ||
118 | + /** | ||
119 | + * 盘盈增加明细 | ||
120 | + * @param | ||
121 | + * @return | ||
122 | + */ | ||
123 | + @AutoLog(value = "盘点盘盈-增加明细") | ||
124 | + @ApiOperation(value = "盘点盘盈-增加明细", notes = "盘点盘盈-增加明细") | ||
125 | + @RequestMapping(value = "/increaseInInventoryGain", method = {RequestMethod.PUT, RequestMethod.POST}) | ||
126 | + public Result<String> increaseInInventoryGain(@RequestBody CycleCountDetailChild cycleCountDetailChild) { | ||
127 | + return cycleCountDetailService.increaseInInventoryGain(cycleCountDetailChild); | ||
128 | + } | ||
192 | 129 | ||
193 | - /** | ||
194 | - * 生成单条盘点任务 | ||
195 | - * | ||
196 | - */ | ||
197 | - @AutoLog(value = "生成单条盘点任务") | ||
198 | - @ApiOperation(value="生成单条盘点任务", notes="生成单条盘点任务") | ||
199 | - @PostMapping(value = "/createCycleCoutTaskByDetailId") | ||
200 | - public Result createCycleCoutTaskByDetailId(@RequestParam(name = "cycleId") Integer cycleId,@RequestParam(name = "toPort") String toPort, HttpServletRequest req){ | ||
201 | - if(cycleId ==null){ | ||
202 | - return Result.error("生成盘点任务时盘点明细ID不能为空!"); | ||
203 | - } | ||
204 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
205 | - return cycleCountDetailService.createCycleCoutTaskByDetailId(cycleId,toPort,warehouseCode); | ||
206 | - } | 130 | + /** |
131 | + * 通过id删除 | ||
132 | + * @param id | ||
133 | + * @return | ||
134 | + */ | ||
135 | + @AutoLog(value = "盘点明细表-通过id删除") | ||
136 | + @ApiOperation(value = "盘点明细表-通过id删除", notes = "盘点明细表-通过id删除") | ||
137 | + @DeleteMapping(value = "/delete") | ||
138 | + public Result<String> delete(@RequestParam(name = "id", required = true) String id) { | ||
139 | + cycleCountDetailService.delMain(id); | ||
140 | + return Result.OK("删除成功!"); | ||
141 | + } | ||
207 | 142 | ||
143 | + /** | ||
144 | + * 批量删除 | ||
145 | + * @param ids | ||
146 | + * @return | ||
147 | + */ | ||
148 | + @AutoLog(value = "盘点明细表-批量删除") | ||
149 | + @ApiOperation(value = "盘点明细表-批量删除", notes = "盘点明细表-批量删除") | ||
150 | + @DeleteMapping(value = "/deleteBatch") | ||
151 | + public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { | ||
152 | + this.cycleCountDetailService.delBatchMain(Arrays.asList(ids.split(","))); | ||
153 | + return Result.OK("批量删除成功!"); | ||
154 | + } | ||
208 | 155 | ||
209 | - /** | ||
210 | - * 选择分拣口 | ||
211 | - * @return | ||
212 | - */ | ||
213 | - @ApiOperation(value = "盘点-选择分拣口", notes = "盘点-选择分拣口") | ||
214 | - @PostMapping("/inventoryPort") | ||
215 | - @ResponseBody | ||
216 | - public Result inventoryPort(@RequestBody CycleCountDetail cycleCountDetail, HttpServletRequest req) { | ||
217 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
218 | - String fromLocationCode = cycleCountDetail.getLocationCode(); | ||
219 | - if (StringUtils.isEmpty(fromLocationCode)) { | ||
220 | - return Result.error("选择分拣口时, 起始库位号为空"); | ||
221 | - } | ||
222 | - Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode); | ||
223 | - if (fromLocation == null) { | ||
224 | - return Result.error("选择分拣口时, 根据库位号" + fromLocationCode + " 没有找到库位"); | ||
225 | - } | ||
226 | - String zoneCode = fromLocation.getZoneCode(); | ||
227 | - if (StringUtils.isEmpty(zoneCode)) { | ||
228 | - return Result.error("选择分拣口时, 库区编码为空"); | ||
229 | - } | ||
230 | - Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode); | ||
231 | - if (zone == null) { | ||
232 | - return Result.error("选择分拣口时, 库区为空"); | ||
233 | - } | ||
234 | - int type = QuantityConstant.PORT_TYPE_PICK; | 156 | + /** |
157 | + * 通过id查询 | ||
158 | + * @param id | ||
159 | + * @return | ||
160 | + */ | ||
161 | + // @AutoLog(value = "盘点明细表-通过id查询") | ||
162 | + @ApiOperation(value = "盘点明细表-通过id查询", notes = "盘点明细表-通过id查询") | ||
163 | + @GetMapping(value = "/queryById") | ||
164 | + public Result<CycleCountDetail> queryById(@RequestParam(name = "id", required = true) String id) { | ||
165 | + CycleCountDetail cycleCountDetail = cycleCountDetailService.getById(id); | ||
166 | + if (cycleCountDetail == null) { | ||
167 | + return Result.error("未找到对应数据"); | ||
168 | + } | ||
169 | + return Result.OK(cycleCountDetail); | ||
235 | 170 | ||
236 | - List<Port> portList = portService.getPortListByType(type, zoneCode, warehouseCode); | ||
237 | - if (portList.size() == 0) { | ||
238 | - return Result.error("选择分拣口时, 没有找到合适的分拣口"); | ||
239 | - } | ||
240 | - return Result.OK(portList); | ||
241 | - } | 171 | + } |
242 | 172 | ||
173 | + /** | ||
174 | + * 生成单条盘点任务 | ||
175 | + */ | ||
176 | + @AutoLog(value = "生成单条盘点任务") | ||
177 | + @ApiOperation(value = "生成单条盘点任务", notes = "生成单条盘点任务") | ||
178 | + @PostMapping(value = "/createCycleCoutTaskByDetailId") | ||
179 | + public Result createCycleCoutTaskByDetailId(@RequestParam(name = "cycleId") Integer cycleId, @RequestParam(name = "toPort") String toPort, | ||
180 | + HttpServletRequest req) { | ||
181 | + if (cycleId == null) { | ||
182 | + return Result.error("生成盘点任务时盘点明细ID不能为空!"); | ||
183 | + } | ||
184 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
185 | + return cycleCountDetailService.createCycleCoutTaskByDetailId(cycleId, toPort, warehouseCode); | ||
186 | + } | ||
243 | 187 | ||
244 | - /** | ||
245 | - * 添加盘点 | ||
246 | - * | ||
247 | - */ | ||
248 | - @AutoLog(value = "盘点添加") | ||
249 | - @ApiOperation(value="盘点添加", notes="盘点添加") | ||
250 | - @PostMapping(value = "/stockTakeTask") | ||
251 | - public Result<String> stockTakeTask(@RequestParam(name = "ids") String ids,@RequestParam(name = "headerId") int headerId,@RequestParam(name = "code") String code) { | ||
252 | - if (StringUtils.isEmpty(ids)) { | ||
253 | - return Result.error("taskId不能为空"); | ||
254 | - } | ||
255 | - Result result = null; | ||
256 | - Integer[] idList = ConvertUtils.toIntArray(ids); | ||
257 | - for (int taskId : idList) { | ||
258 | - result = handleMultiProcess("cancelTask", new HuahengBaseController.MultiProcessListener() { | ||
259 | - @Override | ||
260 | - public Result doProcess() { | ||
261 | - Result result = cycleCountDetailService.stockDetailAdd(taskId,headerId,code); | ||
262 | - return result; | ||
263 | - } | ||
264 | - }); | ||
265 | - } | ||
266 | - result.setResult(headerId); | ||
267 | - return result; | 188 | + /** |
189 | + * 选择分拣口 | ||
190 | + * @return | ||
191 | + */ | ||
192 | + @ApiOperation(value = "盘点-选择分拣口", notes = "盘点-选择分拣口") | ||
193 | + @PostMapping("/inventoryPort") | ||
194 | + @ResponseBody | ||
195 | + public Result inventoryPort(@RequestBody CycleCountDetail cycleCountDetail, HttpServletRequest req) { | ||
196 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
197 | + String fromLocationCode = cycleCountDetail.getLocationCode(); | ||
198 | + if (StringUtils.isEmpty(fromLocationCode)) { | ||
199 | + return Result.error("选择分拣口时, 起始库位号为空"); | ||
200 | + } | ||
201 | + Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode); | ||
202 | + if (fromLocation == null) { | ||
203 | + return Result.error("选择分拣口时, 根据库位号" + fromLocationCode + " 没有找到库位"); | ||
204 | + } | ||
205 | + String zoneCode = fromLocation.getZoneCode(); | ||
206 | + if (StringUtils.isEmpty(zoneCode)) { | ||
207 | + return Result.error("选择分拣口时, 库区编码为空"); | ||
208 | + } | ||
209 | + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode); | ||
210 | + if (zone == null) { | ||
211 | + return Result.error("选择分拣口时, 库区为空"); | ||
212 | + } | ||
213 | + int type = QuantityConstant.PORT_TYPE_PICK; | ||
214 | + | ||
215 | + List<Port> portList = portService.getPortListByType(type, zoneCode, warehouseCode); | ||
216 | + if (portList.size() == 0) { | ||
217 | + return Result.error("选择分拣口时, 没有找到合适的分拣口"); | ||
218 | + } | ||
219 | + return Result.OK(portList); | ||
220 | + } | ||
268 | 221 | ||
269 | - } | 222 | + /** |
223 | + * 添加盘点 | ||
224 | + */ | ||
225 | + @AutoLog(value = "盘点添加") | ||
226 | + @ApiOperation(value = "盘点添加", notes = "盘点添加") | ||
227 | + @PostMapping(value = "/stockTakeTask") | ||
228 | + public Result<String> stockTakeTask(@RequestParam(name = "ids") String ids, @RequestParam(name = "headerId") int headerId, | ||
229 | + @RequestParam(name = "code") String code) { | ||
230 | + if (StringUtils.isEmpty(ids)) { | ||
231 | + return Result.error("taskId不能为空"); | ||
232 | + } | ||
233 | + Result result = null; | ||
234 | + Integer[] idList = ConvertUtils.toIntArray(ids); | ||
235 | + for (int taskId : idList) { | ||
236 | + result = handleMultiProcess("cancelTask", new HuahengBaseController.MultiProcessListener() { | ||
237 | + @Override | ||
238 | + public Result doProcess() { | ||
239 | + Result result = cycleCountDetailService.stockDetailAdd(taskId, headerId, code); | ||
240 | + return result; | ||
241 | + } | ||
242 | + }); | ||
243 | + } | ||
244 | + result.setResult(headerId); | ||
245 | + return result; | ||
270 | 246 | ||
247 | + } | ||
271 | 248 | ||
272 | - /** | ||
273 | - *实盘登记 | ||
274 | - * @return | ||
275 | - */ | ||
276 | - @PostMapping("/confirmGapQty") | ||
277 | - @ResponseBody | ||
278 | - public Result confirmGapQty(@RequestBody Map<String,String> map){ | ||
279 | - String id = map.get("id"); | ||
280 | - String countedQty = map.get("countedQty"); | ||
281 | - String state = map.get("state"); | ||
282 | - return cycleCountDetailChildService.confirmGapQty(id,countedQty,state); | ||
283 | - } | 249 | + /** |
250 | + * 实盘登记 | ||
251 | + * @return | ||
252 | + */ | ||
253 | + @PostMapping("/confirmGapQty") | ||
254 | + @ResponseBody | ||
255 | + public Result confirmGapQty(@RequestBody Map<String, String> map) { | ||
256 | + String id = map.get("id"); | ||
257 | + String countedQty = map.get("countedQty"); | ||
258 | + String state = map.get("state"); | ||
259 | + return cycleCountDetailChildService.confirmGapQty(id, countedQty, state); | ||
260 | + } | ||
284 | 261 | ||
285 | - /** | ||
286 | - * 通过id查询 | ||
287 | - * | ||
288 | - * @param id | ||
289 | - * @return | ||
290 | - */ | ||
291 | - //@AutoLog(value = "盘点容器明细表-通过主表ID查询") | ||
292 | - @ApiOperation(value="盘点容器明细表-通过主表ID查询", notes="盘点容器明细表-通过主表ID查询") | ||
293 | - @GetMapping(value = "/queryCycleCountDetailChildByMainId") | ||
294 | - public Result<IPage<CycleCountDetailChild>> queryCycleCountDetailChildListByMainId(@RequestParam(name="id",required=true) int id) { | ||
295 | - LambdaQueryWrapper<CycleCountDetailChild> cycleCountDetailChildLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
296 | - cycleCountDetailChildLambdaQueryWrapper.eq(CycleCountDetailChild::getCycleCountDetailid, id); | ||
297 | - List<CycleCountDetailChild> cycleCountDetailChildList = cycleCountDetailChildService.list(cycleCountDetailChildLambdaQueryWrapper); | ||
298 | - IPage <CycleCountDetailChild> page = new Page<>(); | ||
299 | - page.setRecords(cycleCountDetailChildList); | ||
300 | - page.setTotal(cycleCountDetailChildList.size()); | ||
301 | - return Result.OK(page); | ||
302 | - } | 262 | + /** |
263 | + * 通过id查询 | ||
264 | + * @param id | ||
265 | + * @return | ||
266 | + */ | ||
267 | + // @AutoLog(value = "盘点容器明细表-通过主表ID查询") | ||
268 | + @ApiOperation(value = "盘点容器明细表-通过主表ID查询", notes = "盘点容器明细表-通过主表ID查询") | ||
269 | + @GetMapping(value = "/queryCycleCountDetailChildByMainId") | ||
270 | + public Result<IPage<CycleCountDetailChild>> queryCycleCountDetailChildListByMainId(@RequestParam(name = "id", required = true) int id) { | ||
271 | + LambdaQueryWrapper<CycleCountDetailChild> cycleCountDetailChildLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
272 | + cycleCountDetailChildLambdaQueryWrapper.eq(CycleCountDetailChild::getCycleCountDetailid, id); | ||
273 | + List<CycleCountDetailChild> cycleCountDetailChildList = cycleCountDetailChildService.list(cycleCountDetailChildLambdaQueryWrapper); | ||
274 | + IPage<CycleCountDetailChild> page = new Page<>(); | ||
275 | + page.setRecords(cycleCountDetailChildList); | ||
276 | + page.setTotal(cycleCountDetailChildList.size()); | ||
277 | + return Result.OK(page); | ||
278 | + } | ||
303 | 279 | ||
304 | /** | 280 | /** |
305 | - * 导出excel | ||
306 | - * | ||
307 | - * @param request | ||
308 | - * @param cycleCountDetail | ||
309 | - */ | 281 | + * 导出excel |
282 | + * @param request | ||
283 | + * @param cycleCountDetail | ||
284 | + */ | ||
310 | @RequestMapping(value = "/exportXls") | 285 | @RequestMapping(value = "/exportXls") |
311 | public ModelAndView exportXls(HttpServletRequest request, CycleCountDetail cycleCountDetail) { | 286 | public ModelAndView exportXls(HttpServletRequest request, CycleCountDetail cycleCountDetail) { |
312 | - // Step.1 组装查询条件查询数据 | ||
313 | - QueryWrapper<CycleCountDetail> queryWrapper = QueryGenerator.initQueryWrapper(cycleCountDetail, request.getParameterMap()); | ||
314 | - LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); | ||
315 | - | ||
316 | - //Step.2 获取导出数据 | ||
317 | - List<CycleCountDetail> queryList = cycleCountDetailService.list(queryWrapper); | ||
318 | - // 过滤选中数据 | ||
319 | - String selections = request.getParameter("selections"); | ||
320 | - List<CycleCountDetail> cycleCountDetailList = new ArrayList<CycleCountDetail>(); | ||
321 | - if(oConvertUtils.isEmpty(selections)) { | ||
322 | - cycleCountDetailList = queryList; | ||
323 | - }else { | ||
324 | - List<String> selectionList = Arrays.asList(selections.split(",")); | ||
325 | - cycleCountDetailList = queryList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList()); | ||
326 | - } | ||
327 | - | ||
328 | - // Step.3 组装pageList | ||
329 | - List<CycleCountDetailPage> pageList = new ArrayList<CycleCountDetailPage>(); | ||
330 | - for (CycleCountDetail main : cycleCountDetailList) { | ||
331 | - CycleCountDetailPage vo = new CycleCountDetailPage(); | ||
332 | - BeanUtils.copyProperties(main, vo); | ||
333 | - LambdaQueryWrapper<CycleCountDetailChild> cycleCountDetailChildLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
334 | - cycleCountDetailChildLambdaQueryWrapper.eq(CycleCountDetailChild::getCycleCountDetailid, main.getId()); | ||
335 | - List<CycleCountDetailChild> cycleCountDetailChildList = cycleCountDetailChildService.list(cycleCountDetailChildLambdaQueryWrapper); | ||
336 | - vo.setCycleCountDetailChildList(cycleCountDetailChildList); | ||
337 | - pageList.add(vo); | ||
338 | - } | ||
339 | - | ||
340 | - // Step.4 AutoPoi 导出Excel | ||
341 | - ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); | ||
342 | - mv.addObject(NormalExcelConstants.FILE_NAME, "盘点明细表列表"); | ||
343 | - mv.addObject(NormalExcelConstants.CLASS, CycleCountDetailPage.class); | ||
344 | - mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("盘点明细表数据", "导出人:"+sysUser.getRealname(), "盘点明细表")); | ||
345 | - mv.addObject(NormalExcelConstants.DATA_LIST, pageList); | ||
346 | - return mv; | 287 | + // Step.1 组装查询条件查询数据 |
288 | + QueryWrapper<CycleCountDetail> queryWrapper = QueryGenerator.initQueryWrapper(cycleCountDetail, request.getParameterMap()); | ||
289 | + LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal(); | ||
290 | + | ||
291 | + // Step.2 获取导出数据 | ||
292 | + List<CycleCountDetail> queryList = cycleCountDetailService.list(queryWrapper); | ||
293 | + // 过滤选中数据 | ||
294 | + String selections = request.getParameter("selections"); | ||
295 | + List<CycleCountDetail> cycleCountDetailList = new ArrayList<CycleCountDetail>(); | ||
296 | + if (oConvertUtils.isEmpty(selections)) { | ||
297 | + cycleCountDetailList = queryList; | ||
298 | + } else { | ||
299 | + List<String> selectionList = Arrays.asList(selections.split(",")); | ||
300 | + cycleCountDetailList = queryList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList()); | ||
301 | + } | ||
302 | + | ||
303 | + // Step.3 组装pageList | ||
304 | + List<CycleCountDetailPage> pageList = new ArrayList<CycleCountDetailPage>(); | ||
305 | + for (CycleCountDetail main : cycleCountDetailList) { | ||
306 | + CycleCountDetailPage vo = new CycleCountDetailPage(); | ||
307 | + BeanUtils.copyProperties(main, vo); | ||
308 | + LambdaQueryWrapper<CycleCountDetailChild> cycleCountDetailChildLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
309 | + cycleCountDetailChildLambdaQueryWrapper.eq(CycleCountDetailChild::getCycleCountDetailid, main.getId()); | ||
310 | + List<CycleCountDetailChild> cycleCountDetailChildList = cycleCountDetailChildService.list(cycleCountDetailChildLambdaQueryWrapper); | ||
311 | + vo.setCycleCountDetailChildList(cycleCountDetailChildList); | ||
312 | + pageList.add(vo); | ||
313 | + } | ||
314 | + | ||
315 | + // Step.4 AutoPoi 导出Excel | ||
316 | + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); | ||
317 | + mv.addObject(NormalExcelConstants.FILE_NAME, "盘点明细表列表"); | ||
318 | + mv.addObject(NormalExcelConstants.CLASS, CycleCountDetailPage.class); | ||
319 | + mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("盘点明细表数据", "导出人:" + sysUser.getRealname(), "盘点明细表")); | ||
320 | + mv.addObject(NormalExcelConstants.DATA_LIST, pageList); | ||
321 | + return mv; | ||
347 | } | 322 | } |
348 | 323 | ||
349 | /** | 324 | /** |
350 | - * 通过excel导入数据 | ||
351 | - * | ||
352 | - * @param request | ||
353 | - * @param response | ||
354 | - * @return | ||
355 | - */ | 325 | + * 通过excel导入数据 |
326 | + * @param request | ||
327 | + * @param response | ||
328 | + * @return | ||
329 | + */ | ||
356 | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | 330 | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
357 | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | 331 | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
358 | - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; | ||
359 | - Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); | ||
360 | - for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { | ||
361 | - MultipartFile file = entity.getValue();// 获取上传文件对象 | ||
362 | - ImportParams params = new ImportParams(); | ||
363 | - params.setTitleRows(2); | ||
364 | - params.setHeadRows(1); | ||
365 | - params.setNeedSave(true); | ||
366 | - try { | ||
367 | - List<CycleCountDetailPage> list = ExcelImportUtil.importExcel(file.getInputStream(), CycleCountDetailPage.class, params); | ||
368 | - for (CycleCountDetailPage page : list) { | ||
369 | - CycleCountDetail po = new CycleCountDetail(); | ||
370 | - BeanUtils.copyProperties(page, po); | ||
371 | - cycleCountDetailService.saveMain(po, page.getCycleCountDetailChildList()); | ||
372 | - } | ||
373 | - return Result.OK("文件导入成功!数据行数:" + list.size()); | ||
374 | - } catch (Exception e) { | ||
375 | - log.error(e.getMessage(),e); | ||
376 | - return Result.error("文件导入失败:"+e.getMessage()); | ||
377 | - } finally { | ||
378 | - try { | ||
379 | - file.getInputStream().close(); | ||
380 | - } catch (IOException e) { | ||
381 | - e.printStackTrace(); | ||
382 | - } | ||
383 | - } | ||
384 | - } | ||
385 | - return Result.OK("文件导入失败!"); | 332 | + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest)request; |
333 | + Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); | ||
334 | + for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { | ||
335 | + MultipartFile file = entity.getValue();// 获取上传文件对象 | ||
336 | + ImportParams params = new ImportParams(); | ||
337 | + params.setTitleRows(2); | ||
338 | + params.setHeadRows(1); | ||
339 | + params.setNeedSave(true); | ||
340 | + try { | ||
341 | + List<CycleCountDetailPage> list = ExcelImportUtil.importExcel(file.getInputStream(), CycleCountDetailPage.class, params); | ||
342 | + for (CycleCountDetailPage page : list) { | ||
343 | + CycleCountDetail po = new CycleCountDetail(); | ||
344 | + BeanUtils.copyProperties(page, po); | ||
345 | + cycleCountDetailService.saveMain(po, page.getCycleCountDetailChildList()); | ||
346 | + } | ||
347 | + return Result.OK("文件导入成功!数据行数:" + list.size()); | ||
348 | + } catch (Exception e) { | ||
349 | + log.error(e.getMessage(), e); | ||
350 | + return Result.error("文件导入失败:" + e.getMessage()); | ||
351 | + } finally { | ||
352 | + try { | ||
353 | + file.getInputStream().close(); | ||
354 | + } catch (IOException e) { | ||
355 | + e.printStackTrace(); | ||
356 | + } | ||
357 | + } | ||
358 | + } | ||
359 | + return Result.OK("文件导入失败!"); | ||
386 | } | 360 | } |
387 | 361 | ||
388 | } | 362 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountHeader/controller/CycleCountHeaderController.java
1 | package org.jeecg.modules.wms.stocktaking.cycleCountHeader.controller; | 1 | package org.jeecg.modules.wms.stocktaking.cycleCountHeader.controller; |
2 | 2 | ||
3 | import java.util.Arrays; | 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; | 4 | + |
10 | import javax.servlet.http.HttpServletRequest; | 5 | import javax.servlet.http.HttpServletRequest; |
11 | import javax.servlet.http.HttpServletResponse; | 6 | import javax.servlet.http.HttpServletResponse; |
7 | + | ||
12 | import org.jeecg.common.api.vo.Result; | 8 | import org.jeecg.common.api.vo.Result; |
9 | +import org.jeecg.common.aspect.annotation.AutoLog; | ||
10 | +import org.jeecg.common.system.base.controller.JeecgController; | ||
13 | import org.jeecg.common.system.query.QueryGenerator; | 11 | import org.jeecg.common.system.query.QueryGenerator; |
14 | -import org.jeecg.common.util.oConvertUtils; | ||
15 | import org.jeecg.modules.wms.stocktaking.cycleCountHeader.entity.CycleCountHeader; | 12 | import org.jeecg.modules.wms.stocktaking.cycleCountHeader.entity.CycleCountHeader; |
16 | import org.jeecg.modules.wms.stocktaking.cycleCountHeader.service.ICycleCountHeaderService; | 13 | import org.jeecg.modules.wms.stocktaking.cycleCountHeader.service.ICycleCountHeaderService; |
17 | - | ||
18 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
19 | -import com.baomidou.mybatisplus.core.metadata.IPage; | ||
20 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
21 | -import lombok.extern.slf4j.Slf4j; | ||
22 | - | ||
23 | import org.jeecg.utils.HuahengJwtUtil; | 14 | import org.jeecg.utils.HuahengJwtUtil; |
24 | import org.jeecg.utils.StringUtils; | 15 | import org.jeecg.utils.StringUtils; |
25 | -import org.jeecgframework.poi.excel.ExcelImportUtil; | ||
26 | -import org.jeecgframework.poi.excel.def.NormalExcelConstants; | ||
27 | -import org.jeecgframework.poi.excel.entity.ExportParams; | ||
28 | -import org.jeecgframework.poi.excel.entity.ImportParams; | ||
29 | -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ||
30 | -import org.jeecg.common.system.base.controller.JeecgController; | ||
31 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
32 | import org.springframework.web.bind.annotation.*; | 17 | import org.springframework.web.bind.annotation.*; |
33 | -import org.springframework.web.multipart.MultipartFile; | ||
34 | -import org.springframework.web.multipart.MultipartHttpServletRequest; | ||
35 | import org.springframework.web.servlet.ModelAndView; | 18 | import org.springframework.web.servlet.ModelAndView; |
36 | -import com.alibaba.fastjson.JSON; | 19 | + |
20 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
21 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
22 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
23 | + | ||
37 | import io.swagger.annotations.Api; | 24 | import io.swagger.annotations.Api; |
38 | import io.swagger.annotations.ApiOperation; | 25 | import io.swagger.annotations.ApiOperation; |
39 | -import org.jeecg.common.aspect.annotation.AutoLog; | 26 | +import lombok.extern.slf4j.Slf4j; |
40 | 27 | ||
41 | - /** | 28 | +/** |
42 | * @Description: 盘点主表 | 29 | * @Description: 盘点主表 |
43 | - * @Author: jeecg-boot | ||
44 | - * @Date: 2023-01-30 | ||
45 | - * @Version: V1.0 | 30 | + * @Author: jeecg-boot |
31 | + * @Date: 2023-01-30 | ||
32 | + * @Version: V1.0 | ||
46 | */ | 33 | */ |
47 | -@Api(tags="盘点主表") | 34 | +@Api(tags = "盘点主表") |
48 | @RestController | 35 | @RestController |
49 | @RequestMapping("/cycleCountHeader/cycleCountHeader") | 36 | @RequestMapping("/cycleCountHeader/cycleCountHeader") |
50 | @Slf4j | 37 | @Slf4j |
51 | public class CycleCountHeaderController extends JeecgController<CycleCountHeader, ICycleCountHeaderService> { | 38 | public class CycleCountHeaderController extends JeecgController<CycleCountHeader, ICycleCountHeaderService> { |
52 | - @Autowired | ||
53 | - private ICycleCountHeaderService cycleCountHeaderService; | 39 | + @Autowired |
40 | + private ICycleCountHeaderService cycleCountHeaderService; | ||
54 | 41 | ||
55 | - /** | ||
56 | - * 分页列表查询 | ||
57 | - * | ||
58 | - * @param cycleCountHeader | ||
59 | - * @param pageNo | ||
60 | - * @param pageSize | ||
61 | - * @param req | ||
62 | - * @return | ||
63 | - */ | ||
64 | - //@AutoLog(value = "盘点主表-分页列表查询") | ||
65 | - @ApiOperation(value="盘点主表-分页列表查询", notes="盘点主表-分页列表查询") | ||
66 | - @GetMapping(value = "/list") | ||
67 | - public Result<IPage<CycleCountHeader>> queryPageList(CycleCountHeader cycleCountHeader, | ||
68 | - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
69 | - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | ||
70 | - HttpServletRequest req) { | ||
71 | - QueryWrapper<CycleCountHeader> queryWrapper = QueryGenerator.initQueryWrapper(cycleCountHeader, req.getParameterMap()); | ||
72 | - Page<CycleCountHeader> page = new Page<CycleCountHeader>(pageNo, pageSize); | ||
73 | - IPage<CycleCountHeader> pageList = cycleCountHeaderService.page(page, queryWrapper); | ||
74 | - return Result.OK(pageList); | ||
75 | - } | 42 | + /** |
43 | + * 分页列表查询 | ||
44 | + * @param cycleCountHeader | ||
45 | + * @param pageNo | ||
46 | + * @param pageSize | ||
47 | + * @param req | ||
48 | + * @return | ||
49 | + */ | ||
50 | + // @AutoLog(value = "盘点主表-分页列表查询") | ||
51 | + @ApiOperation(value = "盘点主表-分页列表查询", notes = "盘点主表-分页列表查询") | ||
52 | + @GetMapping(value = "/list") | ||
53 | + public Result<IPage<CycleCountHeader>> queryPageList(CycleCountHeader cycleCountHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||
54 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | ||
55 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
56 | + cycleCountHeader.setWarehouseCode(warehouseCode); | ||
57 | + QueryWrapper<CycleCountHeader> queryWrapper = QueryGenerator.initQueryWrapper(cycleCountHeader, req.getParameterMap()); | ||
58 | + Page<CycleCountHeader> page = new Page<CycleCountHeader>(pageNo, pageSize); | ||
59 | + IPage<CycleCountHeader> pageList = cycleCountHeaderService.page(page, queryWrapper); | ||
60 | + return Result.OK(pageList); | ||
61 | + } | ||
76 | 62 | ||
77 | - /** | ||
78 | - * 添加 | ||
79 | - * | ||
80 | - * @param cycleCountHeader | ||
81 | - * @return | ||
82 | - */ | ||
83 | - @AutoLog(value = "盘点主表-添加") | ||
84 | - @ApiOperation(value="盘点主表-添加", notes="盘点主表-添加") | ||
85 | - @PostMapping(value = "/add") | ||
86 | - public Result<String> add(@RequestBody CycleCountHeader cycleCountHeader, HttpServletRequest req) { | ||
87 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
88 | - if (StringUtils.isNotEmpty(warehouseCode)) { | ||
89 | - cycleCountHeader.setWarehouseCode(warehouseCode); | ||
90 | - } | ||
91 | - Result result = cycleCountHeaderService.saveCycleCountHeader(cycleCountHeader); | ||
92 | - return result; | ||
93 | - } | 63 | + /** |
64 | + * 添加 | ||
65 | + * @param cycleCountHeader | ||
66 | + * @return | ||
67 | + */ | ||
68 | + @AutoLog(value = "盘点主表-添加") | ||
69 | + @ApiOperation(value = "盘点主表-添加", notes = "盘点主表-添加") | ||
70 | + @PostMapping(value = "/add") | ||
71 | + public Result<String> add(@RequestBody CycleCountHeader cycleCountHeader, HttpServletRequest req) { | ||
72 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
73 | + if (StringUtils.isNotEmpty(warehouseCode)) { | ||
74 | + cycleCountHeader.setWarehouseCode(warehouseCode); | ||
75 | + } | ||
76 | + Result result = cycleCountHeaderService.saveCycleCountHeader(cycleCountHeader); | ||
77 | + return result; | ||
78 | + } | ||
94 | 79 | ||
95 | - /** | ||
96 | - * 编辑 | ||
97 | - * | ||
98 | - * @param cycleCountHeader | ||
99 | - * @return | ||
100 | - */ | ||
101 | - @AutoLog(value = "盘点主表-编辑") | ||
102 | - @ApiOperation(value="盘点主表-编辑", notes="盘点主表-编辑") | ||
103 | - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | ||
104 | - public Result<String> edit(@RequestBody CycleCountHeader cycleCountHeader) { | ||
105 | - cycleCountHeaderService.updateById(cycleCountHeader); | ||
106 | - return Result.OK("编辑成功!"); | ||
107 | - } | 80 | + /** |
81 | + * 编辑 | ||
82 | + * @param cycleCountHeader | ||
83 | + * @return | ||
84 | + */ | ||
85 | + @AutoLog(value = "盘点主表-编辑") | ||
86 | + @ApiOperation(value = "盘点主表-编辑", notes = "盘点主表-编辑") | ||
87 | + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) | ||
88 | + public Result<String> edit(@RequestBody CycleCountHeader cycleCountHeader) { | ||
89 | + cycleCountHeaderService.updateById(cycleCountHeader); | ||
90 | + return Result.OK("编辑成功!"); | ||
91 | + } | ||
108 | 92 | ||
109 | - /** | ||
110 | - * 通过id删除 | ||
111 | - * | ||
112 | - * @param id | ||
113 | - * @return | ||
114 | - */ | ||
115 | - @AutoLog(value = "盘点主表-通过id删除") | ||
116 | - @ApiOperation(value="盘点主表-通过id删除", notes="盘点主表-通过id删除") | ||
117 | - @DeleteMapping(value = "/delete") | ||
118 | - public Result<String> delete(@RequestParam(name="id",required=true) String id) { | ||
119 | - cycleCountHeaderService.removeById(id); | ||
120 | - return Result.OK("删除成功!"); | ||
121 | - } | 93 | + /** |
94 | + * 通过id删除 | ||
95 | + * @param id | ||
96 | + * @return | ||
97 | + */ | ||
98 | + @AutoLog(value = "盘点主表-通过id删除") | ||
99 | + @ApiOperation(value = "盘点主表-通过id删除", notes = "盘点主表-通过id删除") | ||
100 | + @DeleteMapping(value = "/delete") | ||
101 | + public Result<String> delete(@RequestParam(name = "id", required = true) String id) { | ||
102 | + cycleCountHeaderService.removeById(id); | ||
103 | + return Result.OK("删除成功!"); | ||
104 | + } | ||
122 | 105 | ||
123 | - /** | ||
124 | - * 批量删除 | ||
125 | - * | ||
126 | - * @param ids | ||
127 | - * @return | ||
128 | - */ | ||
129 | - @AutoLog(value = "盘点主表-批量删除") | ||
130 | - @ApiOperation(value="盘点主表-批量删除", notes="盘点主表-批量删除") | ||
131 | - @DeleteMapping(value = "/deleteBatch") | ||
132 | - public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | ||
133 | - this.cycleCountHeaderService.removeByIds(Arrays.asList(ids.split(","))); | ||
134 | - return Result.OK("批量删除成功!"); | ||
135 | - } | 106 | + /** |
107 | + * 批量删除 | ||
108 | + * @param ids | ||
109 | + * @return | ||
110 | + */ | ||
111 | + @AutoLog(value = "盘点主表-批量删除") | ||
112 | + @ApiOperation(value = "盘点主表-批量删除", notes = "盘点主表-批量删除") | ||
113 | + @DeleteMapping(value = "/deleteBatch") | ||
114 | + public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { | ||
115 | + this.cycleCountHeaderService.removeByIds(Arrays.asList(ids.split(","))); | ||
116 | + return Result.OK("批量删除成功!"); | ||
117 | + } | ||
136 | 118 | ||
137 | - /** | ||
138 | - * 通过id查询 | ||
139 | - * | ||
140 | - * @param id | ||
141 | - * @return | ||
142 | - */ | ||
143 | - //@AutoLog(value = "盘点主表-通过id查询") | ||
144 | - @ApiOperation(value="盘点主表-通过id查询", notes="盘点主表-通过id查询") | ||
145 | - @GetMapping(value = "/queryById") | ||
146 | - public Result<CycleCountHeader> queryById(@RequestParam(name="id",required=true) String id) { | ||
147 | - CycleCountHeader cycleCountHeader = cycleCountHeaderService.getById(id); | ||
148 | - if(cycleCountHeader==null) { | ||
149 | - return Result.error("未找到对应数据"); | ||
150 | - } | ||
151 | - return Result.OK(cycleCountHeader); | ||
152 | - } | 119 | + /** |
120 | + * 通过id查询 | ||
121 | + * @param id | ||
122 | + * @return | ||
123 | + */ | ||
124 | + // @AutoLog(value = "盘点主表-通过id查询") | ||
125 | + @ApiOperation(value = "盘点主表-通过id查询", notes = "盘点主表-通过id查询") | ||
126 | + @GetMapping(value = "/queryById") | ||
127 | + public Result<CycleCountHeader> queryById(@RequestParam(name = "id", required = true) String id) { | ||
128 | + CycleCountHeader cycleCountHeader = cycleCountHeaderService.getById(id); | ||
129 | + if (cycleCountHeader == null) { | ||
130 | + return Result.error("未找到对应数据"); | ||
131 | + } | ||
132 | + return Result.OK(cycleCountHeader); | ||
133 | + } | ||
153 | 134 | ||
154 | /** | 135 | /** |
155 | - * 导出excel | ||
156 | - * | ||
157 | - * @param request | ||
158 | - * @param cycleCountHeader | ||
159 | - */ | 136 | + * 导出excel |
137 | + * @param request | ||
138 | + * @param cycleCountHeader | ||
139 | + */ | ||
160 | @RequestMapping(value = "/exportXls") | 140 | @RequestMapping(value = "/exportXls") |
161 | public ModelAndView exportXls(HttpServletRequest request, CycleCountHeader cycleCountHeader) { | 141 | public ModelAndView exportXls(HttpServletRequest request, CycleCountHeader cycleCountHeader) { |
162 | return super.exportXls(request, cycleCountHeader, CycleCountHeader.class, "盘点主表"); | 142 | return super.exportXls(request, cycleCountHeader, CycleCountHeader.class, "盘点主表"); |
163 | } | 143 | } |
164 | 144 | ||
165 | /** | 145 | /** |
166 | - * 通过excel导入数据 | ||
167 | - * | ||
168 | - * @param request | ||
169 | - * @param response | ||
170 | - * @return | ||
171 | - */ | 146 | + * 通过excel导入数据 |
147 | + * @param request | ||
148 | + * @param response | ||
149 | + * @return | ||
150 | + */ | ||
172 | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) | 151 | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
173 | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | 152 | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
174 | return super.importExcel(request, response, CycleCountHeader.class); | 153 | return super.importExcel(request, response, CycleCountHeader.class); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/controller/AgvTaskController.java
@@ -50,6 +50,8 @@ public class AgvTaskController extends JeecgController<AgvTask, IAgvTaskService> | @@ -50,6 +50,8 @@ public class AgvTaskController extends JeecgController<AgvTask, IAgvTaskService> | ||
50 | @GetMapping(value = "/list") | 50 | @GetMapping(value = "/list") |
51 | public Result<IPage<AgvTask>> queryPageList(AgvTask agvTask, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 51 | public Result<IPage<AgvTask>> queryPageList(AgvTask agvTask, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
52 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | 52 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
53 | + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | ||
54 | + agvTask.setWarehouseCode(warehouseCode); | ||
53 | QueryWrapper<AgvTask> queryWrapper = QueryGenerator.initQueryWrapper(agvTask, req.getParameterMap()); | 55 | QueryWrapper<AgvTask> queryWrapper = QueryGenerator.initQueryWrapper(agvTask, req.getParameterMap()); |
54 | Page<AgvTask> page = new Page<AgvTask>(pageNo, pageSize); | 56 | Page<AgvTask> page = new Page<AgvTask>(pageNo, pageSize); |
55 | IPage<AgvTask> pageList = agvTaskService.page(page, queryWrapper); | 57 | IPage<AgvTask> pageList = agvTaskService.page(page, queryWrapper); |