Commit 5b9418461ce3a92053e99ab097e31a60571d8ebd

Authored by 肖超群
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 1 package org.jeecg.modules.wms.config.address.controller;
2 2  
3 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 5 import javax.servlet.http.HttpServletRequest;
11 6 import javax.servlet.http.HttpServletResponse;
12 7  
13 8 import org.apache.shiro.authz.annotation.RequiresPermissions;
14 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 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 13 import org.jeecg.modules.wms.config.address.entity.Address;
25 14 import org.jeecg.modules.wms.config.address.service.IAddressService;
  15 +import org.jeecg.utils.HuahengJwtUtil;
26 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 17 import org.springframework.beans.factory.annotation.Autowired;
34 18 import org.springframework.web.bind.annotation.*;
35   -import org.springframework.web.multipart.MultipartFile;
36   -import org.springframework.web.multipart.MultipartHttpServletRequest;
37 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 25 import io.swagger.annotations.Api;
40 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 30 * @Description: 接口地址
... ... @@ -67,6 +53,8 @@ public class AddressController extends JeecgController<Address, IAddressService>
67 53 @GetMapping(value = "/list")
68 54 public Result<IPage<Address>> queryPageList(Address address, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
69 55 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
  56 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  57 + address.setWarehouseCode(warehouseCode);
70 58 QueryWrapper<Address> queryWrapper = QueryGenerator.initQueryWrapper(address, req.getParameterMap());
71 59 Page<Address> page = new Page<Address>(pageNo, pageSize);
72 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 12 import org.jeecg.common.system.query.QueryGenerator;
13 13 import org.jeecg.modules.wms.config.agvPort.entity.AgvPort;
14 14 import org.jeecg.modules.wms.config.agvPort.service.IAgvPortService;
  15 +import org.jeecg.utils.HuahengJwtUtil;
15 16 import org.springframework.beans.factory.annotation.Autowired;
16 17 import org.springframework.web.bind.annotation.*;
17 18 import org.springframework.web.servlet.ModelAndView;
... ... @@ -51,6 +52,8 @@ public class AgvPortController extends JeecgController&lt;AgvPort, IAgvPortService&gt;
51 52 @GetMapping(value = "/list")
52 53 public Result<IPage<AgvPort>> queryPageList(AgvPort agvPort, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
53 54 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
  55 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  56 + agvPort.setWarehouseCode(warehouseCode);
54 57 QueryWrapper<AgvPort> queryWrapper = QueryGenerator.initQueryWrapper(agvPort, req.getParameterMap());
55 58 Page<AgvPort> page = new Page<AgvPort>(pageNo, pageSize);
56 59 IPage<AgvPort> pageList = agvPortService.page(page, queryWrapper);
... ... @@ -66,7 +69,9 @@ public class AgvPortController extends JeecgController&lt;AgvPort, IAgvPortService&gt;
66 69 @ApiOperation(value = "AGV点位-添加", notes = "AGV点位-添加")
67 70 @PostMapping(value = "/add")
68 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 75 agvPortService.save(agvPort);
71 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 2  
3 3 import java.util.Arrays;
4 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 6 import javax.servlet.http.HttpServletRequest;
11 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 9 import org.apache.shiro.authz.annotation.RequiresPermissions;
16 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 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 14 import org.jeecg.modules.wms.config.cycleCountPreference.entity.CycleCountPreference;
28 15 import org.jeecg.modules.wms.config.cycleCountPreference.service.ICycleCountPreferenceService;
  16 +import org.jeecg.utils.HuahengJwtUtil;
29 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 18 import org.springframework.beans.factory.annotation.Autowired;
37 19 import org.springframework.web.bind.annotation.*;
38   -import org.springframework.web.multipart.MultipartFile;
39   -import org.springframework.web.multipart.MultipartHttpServletRequest;
40 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 28 import io.swagger.annotations.Api;
43 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 33 * @Description: 盘点首选项
... ... @@ -71,6 +57,8 @@ public class CycleCountPreferenceController extends JeecgController&lt;CycleCountPr
71 57 public Result<IPage<CycleCountPreference>> queryPageList(CycleCountPreference cycleCountPreference,
72 58 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
73 59 HttpServletRequest req) {
  60 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  61 + cycleCountPreference.setWarehouseCode(warehouseCode);
74 62 QueryWrapper<CycleCountPreference> queryWrapper = QueryGenerator.initQueryWrapper(cycleCountPreference, req.getParameterMap());
75 63 Page<CycleCountPreference> page = new Page<CycleCountPreference>(pageNo, pageSize);
76 64 IPage<CycleCountPreference> pageList = cycleCountPreferenceService.page(page, queryWrapper);
... ... @@ -137,8 +125,6 @@ public class CycleCountPreferenceController extends JeecgController&lt;CycleCountPr
137 125 return Result.OK("批量删除成功!");
138 126 }
139 127  
140   -
141   -
142 128 /**
143 129 * 获得盘点类型信息
144 130 * @param req
... ... @@ -152,8 +138,6 @@ public class CycleCountPreferenceController extends JeecgController&lt;CycleCountPr
152 138 return Result.OK(cycleCountPreferenceList);
153 139 }
154 140  
155   -
156   -
157 141 /**
158 142 * 通过id查询
159 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 51 */
52 52 @GetMapping("/getStatus")
53 53 @ResponseBody
54   - public Result getStatus(String zoneCode) {
  54 + public Result getStatus(String zoneCode, HttpServletRequest req) {
  55 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
55 56 HashMap<String, Integer> map = new HashMap<>();
56 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 59 List<Location> locationList = locationService.list(queryWrapper);
59 60 map.put("location", locationList.size());
60 61 // 换stream进行数据拣选速度更快
61 62 List<Location> emptyLocationList = locationList.stream().filter(t -> StringUtils.isEmpty(t.getContainerCode())).collect(Collectors.toList());
62 63 map.put("emptyLocation", emptyLocationList.size());
63 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 67 List<String> containerCodeList =
67 68 containerList.stream().filter(t -> t.getStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY)).map(Container::getCode).collect(Collectors.toList());
68 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&lt;Material, IMaterialServi
56 56 @GetMapping(value = "/list")
57 57 public Result<IPage<Material>> queryPageList(Material material, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
58 58 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
  59 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  60 + material.setWarehouseCode(warehouseCode);
59 61 QueryWrapper<Material> queryWrapper = QueryGenerator.initQueryWrapper(material, req.getParameterMap());
60 62 Page<Material> page = new Page<Material>(pageNo, pageSize);
61 63 IPage<Material> pageList = materialService.page(page, queryWrapper);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/InventoryMaterialSummary/controller/InventoryMaterialSummaryController.java
1 1 package org.jeecg.modules.wms.inventory.InventoryMaterialSummary.controller;
2 2  
3   -import java.util.Arrays;
4   -import java.util.Collections;
5 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 5 import javax.annotation.Resource;
12 6 import javax.servlet.http.HttpServletRequest;
13 7 import javax.servlet.http.HttpServletResponse;
14 8  
15   -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
16 9 import org.jeecg.common.api.vo.Result;
  10 +import org.jeecg.common.system.base.controller.JeecgController;
17 11 import org.jeecg.common.system.query.QueryGenerator;
18   -import org.jeecg.common.util.oConvertUtils;
19 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 13 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
27 14 import org.jeecg.modules.wms.inventory.inventoryHeader.service.impl.InventoryDetailServiceImpl;
  15 +import org.jeecg.utils.HuahengJwtUtil;
28 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 17 import org.springframework.web.bind.annotation.*;
37   -import org.springframework.web.multipart.MultipartFile;
38   -import org.springframework.web.multipart.MultipartHttpServletRequest;
39 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 25 import io.swagger.annotations.Api;
42 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 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 36 @RestController
53 37 @RequestMapping("/InventoryMaterialSummary/inventoryMaterialSummary")
54 38 @Slf4j
55 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 97 @RequestMapping(value = "/exportXls")
122 98 public ModelAndView exportXls(HttpServletRequest request, InventoryDetail inventoryMaterialSummary) {
123 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 108 @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
134 109 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
135 110 return super.importExcel(request, response, InventoryDetail.class);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/controller/InventoryHeaderController.java
1 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 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 19 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
12 20 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader;
13 21 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
14 22 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService;
  23 +import org.jeecg.utils.HuahengJwtUtil;
  24 +import org.jeecg.utils.StringUtils;
15 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 26 import org.jeecgframework.poi.excel.ExcelImportUtil;
29 27 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
30 28 import org.jeecgframework.poi.excel.entity.ExportParams;
31 29 import org.jeecgframework.poi.excel.entity.ImportParams;
32 30 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
  31 +import org.springframework.beans.factory.annotation.Autowired;
  32 +import org.springframework.web.bind.annotation.*;
33 33 import org.springframework.web.multipart.MultipartFile;
34 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 46 * @Description: 库存表
... ... @@ -70,6 +75,8 @@ public class InventoryHeaderController extends JeecgController&lt;InventoryHeader,
70 75 @GetMapping(value = "/list")
71 76 public Result<IPage<InventoryHeader>> queryPageList(InventoryHeader inventoryHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
72 77 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
  78 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  79 + inventoryHeader.setWarehouseCode(warehouseCode);
73 80 QueryWrapper<InventoryHeader> queryWrapper = QueryGenerator.initQueryWrapper(inventoryHeader, req.getParameterMap());
74 81 Page<InventoryHeader> page = new Page<InventoryHeader>(pageNo, pageSize);
75 82 IPage<InventoryHeader> pageList = inventoryHeaderService.page(page, queryWrapper);
... ... @@ -86,7 +93,9 @@ public class InventoryHeaderController extends JeecgController&lt;InventoryHeader,
86 93 @PostMapping(value = "/add")
87 94 public Result<String> add(@RequestBody InventoryHeader inventoryHeader, HttpServletRequest req) {
88 95 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
89   - inventoryHeader.setWarehouseCode(warehouseCode);
  96 + if (StringUtils.isNotEmpty(warehouseCode)) {
  97 + inventoryHeader.setWarehouseCode(warehouseCode);
  98 + }
90 99 inventoryHeaderService.save(inventoryHeader);
91 100 return Result.OK("添加成功!");
92 101 }
... ... @@ -264,9 +273,7 @@ public class InventoryHeaderController extends JeecgController&lt;InventoryHeader,
264 273 @ApiOperation(value = "库存表-有货非锁定列表查询", notes = "库存表-有货非锁定列表查询")
265 274 @GetMapping(value = "/freeList")
266 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 278 QueryWrapper<InventoryHeader> queryWrapper = QueryGenerator.initQueryWrapper(inventoryHeader, req.getParameterMap());
272 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 1 package org.jeecg.modules.wms.inventory.inventoryTransaction.controller;
2 2  
3 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 5 import javax.servlet.http.HttpServletRequest;
11 6 import javax.servlet.http.HttpServletResponse;
  7 +
12 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 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 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 19 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
18 20 import com.baomidou.mybatisplus.core.metadata.IPage;
19 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 23 import io.swagger.annotations.Api;
37 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 28 * @Description: 库存交易记录
... ... @@ -65,6 +52,8 @@ public class InventoryTransactionController extends JeecgController&lt;InventoryTra
65 52 public Result<IPage<InventoryTransaction>> queryPageList(InventoryTransaction inventoryTransaction,
66 53 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
67 54 HttpServletRequest req) {
  55 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  56 + inventoryTransaction.setWarehouseCode(warehouseCode);
68 57 QueryWrapper<InventoryTransaction> queryWrapper = QueryGenerator.initQueryWrapper(inventoryTransaction, req.getParameterMap());
69 58 Page<InventoryTransaction> page = new Page<InventoryTransaction>(pageNo, pageSize);
70 59 IPage<InventoryTransaction> pageList = inventoryTransactionService.page(page, queryWrapper);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/controller/ApiLogController.java
1 1 package org.jeecg.modules.wms.monitor.apiLog.controller;
2 2  
3 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 5 import javax.servlet.http.HttpServletRequest;
11 6 import javax.servlet.http.HttpServletResponse;
  7 +
12 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 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 12 import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog;
22 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 14 import org.springframework.beans.factory.annotation.Autowired;
30 15 import org.springframework.web.bind.annotation.*;
31   -import org.springframework.web.multipart.MultipartFile;
32   -import org.springframework.web.multipart.MultipartHttpServletRequest;
33 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 22 import io.swagger.annotations.Api;
36 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 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&lt;ReceiptCon
91 91 public Result<IPage<ReceiptContainerHeader>> queryPageList(ReceiptContainerHeader receiptContainerHeader,
92 92 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
93 93 HttpServletRequest req) {
  94 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  95 + receiptContainerHeader.setWarehouseCode(warehouseCode);
94 96 QueryWrapper<ReceiptContainerHeader> queryWrapper = QueryGenerator.initQueryWrapper(receiptContainerHeader, req.getParameterMap());
95 97 Page<ReceiptContainerHeader> page = new Page<ReceiptContainerHeader>(pageNo, pageSize);
96 98 IPage<ReceiptContainerHeader> pageList = receiptContainerHeaderService.page(page, queryWrapper);
... ... @@ -106,7 +108,11 @@ public class ReceiptContainerHeaderController extends JeecgController&lt;ReceiptCon
106 108 @ApiOperation(value = "入库组盘-添加", notes = "入库组盘-添加")
107 109 @RequiresPermissions("receiptContainerHeader:add")
108 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 116 receiptContainerHeaderService.save(receiptContainerHeader);
111 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&lt;ReceiptHeader, IRec
96 96 @GetMapping(value = "/list")
97 97 public Result<IPage<ReceiptHeader>> queryPageList(ReceiptHeader receiptHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
98 98 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
  99 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  100 + receiptHeader.setWarehouseCode(warehouseCode);
99 101 QueryWrapper<ReceiptHeader> queryWrapper = QueryGenerator.initQueryWrapper(receiptHeader, req.getParameterMap());
100 102 Page<ReceiptHeader> page = new Page<ReceiptHeader>(pageNo, pageSize);
101 103 IPage<ReceiptHeader> pageList = receiptHeaderService.page(page, queryWrapper);
... ... @@ -210,9 +212,8 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec
210 212 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
211 213 LambdaQueryWrapper<ReceiptDetail> query = Wrappers.lambdaQuery();
212 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 217 Page<ReceiptDetail> page = new Page<ReceiptDetail>(pageNo, pageSize);
217 218 IPage<ReceiptDetail> pageList = receiptDetailService.page(page, query);
218 219 return Result.ok(pageList);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java
1 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 9 import org.jeecg.common.api.vo.Result;
11 10 import org.jeecg.common.aspect.annotation.AutoLog;
12   -import org.jeecg.common.system.query.QueryGenerator;
13   -import org.jeecg.utils.HuahengJwtUtil;
14 11 import org.jeecg.modules.wms.config.location.entity.Location;
15 12 import org.jeecg.modules.wms.config.location.service.ILocationService;
16 13 import org.jeecg.modules.wms.config.port.entity.Port;
... ... @@ -19,10 +16,6 @@ import org.jeecg.modules.wms.config.zone.entity.Zone;
19 16 import org.jeecg.modules.wms.config.zone.service.IZoneService;
20 17 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
21 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 19 import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel;
27 20 import org.jeecg.modules.wms.shipment.shipmentCombination.entity.Shipment;
28 21 import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService;
... ... @@ -31,15 +24,17 @@ import org.jeecg.modules.wms.shipment.shipmentHeader.entity.CombinationParam;
31 24 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
32 25 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader;
33 26 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService;
  27 +import org.jeecg.utils.HuahengJwtUtil;
34 28 import org.jeecg.utils.StringUtils;
35 29 import org.jeecg.utils.constant.QuantityConstant;
36 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 40 * @author 游杰
... ... @@ -72,7 +67,7 @@ public class ShipmentCombinationController {
72 67 @ResponseBody
73 68 public Result getShipmentDetailListByShipmentCode(String shipmentCode, HttpServletRequest req) {
74 69 if (StringUtils.isEmpty(shipmentCode)) {
75   - return null;
  70 + return Result.error("没有找到出库单号");
76 71 }
77 72 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
78 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 21 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
22 22 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService;
23 23 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService;
  24 +import org.jeecg.utils.HuahengJwtUtil;
  25 +import org.jeecg.utils.StringUtils;
24 26 import org.jeecgframework.poi.excel.ExcelImportUtil;
25 27 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
26 28 import org.jeecgframework.poi.excel.entity.ExportParams;
... ... @@ -74,6 +76,8 @@ public class ShipmentContainerHeaderController extends JeecgController&lt;ShipmentC
74 76 public Result<IPage<ShipmentContainerHeader>> queryPageList(ShipmentContainerHeader shipmentContainerHeader,
75 77 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
76 78 HttpServletRequest req) {
  79 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  80 + shipmentContainerHeader.setWarehouseCode(warehouseCode);
77 81 QueryWrapper<ShipmentContainerHeader> queryWrapper = QueryGenerator.initQueryWrapper(shipmentContainerHeader, req.getParameterMap());
78 82 Page<ShipmentContainerHeader> page = new Page<ShipmentContainerHeader>(pageNo, pageSize);
79 83 IPage<ShipmentContainerHeader> pageList = shipmentContainerHeaderService.page(page, queryWrapper);
... ... @@ -89,7 +93,11 @@ public class ShipmentContainerHeaderController extends JeecgController&lt;ShipmentC
89 93 @ApiOperation(value = "出库组盘-添加", notes = "出库组盘-添加")
90 94 @PostMapping(value = "/add")
91 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 101 shipmentContainerHeaderService.save(shipmentContainerHeader);
94 102 return Result.OK("添加成功!");
95 103 }
... ... @@ -166,6 +174,8 @@ public class ShipmentContainerHeaderController extends JeecgController&lt;ShipmentC
166 174 public Result<IPage<ShipmentContainerDetail>> listShipmentContainerDetailByMainId(ShipmentContainerDetail shipmentContainerDetail,
167 175 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
168 176 HttpServletRequest req) {
  177 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  178 + shipmentContainerDetail.setWarehouseCode(warehouseCode);
169 179 QueryWrapper<ShipmentContainerDetail> queryWrapper = QueryGenerator.initQueryWrapper(shipmentContainerDetail, req.getParameterMap());
170 180 Page<ShipmentContainerDetail> page = new Page<ShipmentContainerDetail>(pageNo, pageSize);
171 181 IPage<ShipmentContainerDetail> pageList = shipmentContainerDetailService.page(page, queryWrapper);
... ... @@ -181,7 +191,11 @@ public class ShipmentContainerHeaderController extends JeecgController&lt;ShipmentC
181 191 @ApiOperation(value = "出库组盘详情-添加", notes = "出库组盘详情-添加")
182 192 @RequiresPermissions("shipmentContainerDetail:add")
183 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 199 shipmentContainerDetailService.save(shipmentContainerDetail);
186 200 return Result.OK("添加成功!");
187 201 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeaderHistory/controller/ShipmentHeaderHistoryController.java
1 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 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 11 import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentDetailHistory;
16 12 import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.entity.ShipmentHeaderHistory;
17   -import org.jeecg.modules.wms.shipment.shipmentHeaderHistory.service.IShipmentHeaderHistoryService;
18 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 23 import io.swagger.annotations.Api;
20 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 28 * @Description: 历史出库单
... ... @@ -54,6 +58,8 @@ public class ShipmentHeaderHistoryController extends JeecgController&lt;ShipmentHea
54 58 public Result<IPage<ShipmentHeaderHistory>> queryPageList(ShipmentHeaderHistory shipmentHeaderHistory,
55 59 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
56 60 HttpServletRequest req) {
  61 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  62 + shipmentHeaderHistory.setWarehouseCode(warehouseCode);
57 63 QueryWrapper<ShipmentHeaderHistory> queryWrapper = QueryGenerator.initQueryWrapper(shipmentHeaderHistory, req.getParameterMap());
58 64 Page<ShipmentHeaderHistory> page = new Page<>(pageNo, pageSize);
59 65 IPage<ShipmentHeaderHistory> pageList = shipmentHeaderHistoryService.page(page, queryWrapper);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java
1 1 package org.jeecg.modules.wms.stocktaking.cycleCountDetail.controller;
2 2  
3   -import java.io.UnsupportedEncodingException;
4 3 import java.io.IOException;
5   -import java.math.BigDecimal;
6   -import java.net.URLDecoder;
7 4 import java.util.ArrayList;
8 5 import java.util.Arrays;
9 6 import java.util.List;
... ... @@ -12,9 +9,14 @@ import java.util.stream.Collectors;
12 9  
13 10 import javax.annotation.Resource;
14 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 20 import org.jeecg.modules.wms.config.location.entity.Location;
19 21 import org.jeecg.modules.wms.config.location.service.impl.LocationServiceImpl;
20 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 24 import org.jeecg.modules.wms.config.zone.entity.Zone;
23 25 import org.jeecg.modules.wms.config.zone.service.impl.ZoneServiceImpl;
24 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 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 33 import org.jeecg.utils.ConvertUtils;
35 34 import org.jeecg.utils.HuahengJwtUtil;
36 35 import org.jeecg.utils.StringUtils;
... ... @@ -40,349 +39,324 @@ import org.jeecgframework.poi.excel.def.NormalExcelConstants;
40 39 import org.jeecgframework.poi.excel.entity.ExportParams;
41 40 import org.jeecgframework.poi.excel.entity.ImportParams;
42 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 42 import org.springframework.beans.BeanUtils;
54 43 import org.springframework.beans.factory.annotation.Autowired;
55 44 import org.springframework.web.bind.annotation.*;
56   -import org.springframework.web.servlet.ModelAndView;
57 45 import org.springframework.web.multipart.MultipartFile;
58 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 50 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
60 51 import com.baomidou.mybatisplus.core.metadata.IPage;
  52 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
61 53 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
62   -import lombok.extern.slf4j.Slf4j;
63   -import com.alibaba.fastjson.JSON;
  54 +
64 55 import io.swagger.annotations.Api;
65 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 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 66 @RestController
76 67 @RequestMapping("/cycleCountDetail/cycleCountDetail")
77 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 285 @RequestMapping(value = "/exportXls")
311 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 330 @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
357 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 1 package org.jeecg.modules.wms.stocktaking.cycleCountHeader.controller;
2 2  
3 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 5 import javax.servlet.http.HttpServletRequest;
11 6 import javax.servlet.http.HttpServletResponse;
  7 +
12 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 11 import org.jeecg.common.system.query.QueryGenerator;
14   -import org.jeecg.common.util.oConvertUtils;
15 12 import org.jeecg.modules.wms.stocktaking.cycleCountHeader.entity.CycleCountHeader;
16 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 14 import org.jeecg.utils.HuahengJwtUtil;
24 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 16 import org.springframework.beans.factory.annotation.Autowired;
32 17 import org.springframework.web.bind.annotation.*;
33   -import org.springframework.web.multipart.MultipartFile;
34   -import org.springframework.web.multipart.MultipartHttpServletRequest;
35 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 24 import io.swagger.annotations.Api;
38 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 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 35 @RestController
49 36 @RequestMapping("/cycleCountHeader/cycleCountHeader")
50 37 @Slf4j
51 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 140 @RequestMapping(value = "/exportXls")
161 141 public ModelAndView exportXls(HttpServletRequest request, CycleCountHeader cycleCountHeader) {
162 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 151 @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
173 152 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
174 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&lt;AgvTask, IAgvTaskService&gt;
50 50 @GetMapping(value = "/list")
51 51 public Result<IPage<AgvTask>> queryPageList(AgvTask agvTask, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
52 52 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
  53 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  54 + agvTask.setWarehouseCode(warehouseCode);
53 55 QueryWrapper<AgvTask> queryWrapper = QueryGenerator.initQueryWrapper(agvTask, req.getParameterMap());
54 56 Page<AgvTask> page = new Page<AgvTask>(pageNo, pageSize);
55 57 IPage<AgvTask> pageList = agvTaskService.page(page, queryWrapper);
... ...