Commit feffc7d9e34bdb1518ac32263aaa3d41d52bf06b

Authored by 肖超群
1 parent cdd83c0a

增加用户库区

ant-design-vue-jeecg/src/views/system/UserList.vue
... ... @@ -119,6 +119,12 @@
119 119 </a-tag>
120 120 </span>
121 121  
  122 + <span slot="zoneCodes" slot-scope="zoneCodes" >
  123 + <a-tag v-for="zoneCode in zoneCodes" :key="zoneCode" color=pink>
  124 + {{ solutionZoneCode(zoneCode) }}
  125 + </a-tag>
  126 + </span>
  127 +
122 128 <template slot="avatarslot" slot-scope="text, record">
123 129 <div class="anty-img-wrap">
124 130 <a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/>
... ... @@ -190,7 +196,7 @@
190 196 import UserModal from './modules/UserModal'
191 197 import PasswordModal from './modules/PasswordModal'
192 198 import {putAction, getFileAccessHttpUrl} from '@/api/manage';
193   -import {frozenBatch, getAllWarehouseList, queryall} from '@/api/api'
  199 +import {frozenBatch, getAllWarehouseList, queryall, getZoneList} from '@/api/api'
194 200 import {JeecgListMixin} from '@/mixins/JeecgListMixin'
195 201 import SysUserAgentModal from "./modules/SysUserAgentModal";
196 202 import JInput from '@/components/jeecg/JInput'
... ... @@ -216,6 +222,7 @@ export default {
216 222 queryParam: {},
217 223 recycleBinVisible: false,
218 224 allWarehouseList: [],
  225 + zoneList: [],
219 226 rolesOptions: [],
220 227 columns: [
221 228 /*{
... ... @@ -287,6 +294,13 @@ export default {
287 294 key: 'selectedWarehouses',
288 295 scopedSlots: {customRender: 'selectedWarehouses'}
289 296 },
  297 + {
  298 + title: '所属库区',
  299 + align: "center",
  300 + dataIndex: 'zoneCodes',
  301 + key: 'zoneCodes',
  302 + scopedSlots: {customRender: 'zoneCodes'}
  303 + },
290 304 // {
291 305 // title: '部门',
292 306 // align: "center",
... ... @@ -338,6 +352,11 @@ export default {
338 352 },
339 353 methods: {
340 354 loadFrom() {
  355 + getZoneList().then((res) => {
  356 + if (res.success) {
  357 + this.zoneList = res.result
  358 + }
  359 + });
341 360 getAllWarehouseList().then((res) => {
342 361 if (res.success) {
343 362 this.allWarehouseList = res.result
... ... @@ -363,6 +382,16 @@ export default {
363 382 })
364 383 return actions.join('')
365 384 },
  385 + solutionZoneCode(value) {
  386 + var actions = []
  387 + Object.keys(this.zoneList).some((key) => {
  388 + if (this.zoneList[key].code == ('' + value)) {
  389 + actions.push(this.zoneList[key].name)
  390 + return true
  391 + }
  392 + })
  393 + return actions.join('')
  394 + },
366 395 solutionRole(value) {
367 396 var actions = []
368 397 Object.keys(this.rolesOptions).some((key) => {
... ...
ant-design-vue-jeecg/src/views/system/modules/UserModal.vue
... ... @@ -70,6 +70,15 @@
70 70 </j-multi-select-tag>
71 71 </a-form-model-item>
72 72  
  73 + <a-form-model-item label="库区分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!warehouseDisable" prop="selectedZoneCode">
  74 + <j-multi-select-tag
  75 + :disabled="disableSubmit"
  76 + v-model="model.selectedZoneCode"
  77 + :options="zoneOptions"
  78 + placeholder="请选择仓库">
  79 + </j-multi-select-tag>
  80 + </a-form-model-item>
  81 +
73 82 <!--部门分配-->
74 83 <!-- <a-form-model-item label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
75 84 <j-select-depart v-model="model.selecteddeparts" :multi="true" @back="backDepartInfo" :backDepart="true" :treeOpera="true">
... ... @@ -153,7 +162,7 @@ import moment from &#39;moment&#39;
153 162 import Vue from 'vue'
154 163 import {ACCESS_TOKEN} from "@/store/mutation-types"
155 164 import {getAction} from '@/api/manage'
156   -import {addUser, editUser, queryUserRole, queryall, queryWarehouse, getAllWarehouseList} from '@/api/api'
  165 +import {addUser, editUser, queryUserRole, queryall, queryWarehouse, getAllWarehouseList, getAllZoneList} from '@/api/api'
157 166 import {disabledAuthFilter} from "@/utils/authFilter"
158 167 import {duplicateCheck} from '@/api/api'
159 168  
... ... @@ -216,6 +225,7 @@ export default {
216 225 queryTenantList: '/sys/tenant/queryList'
217 226 },
218 227 tenantsOptions: [],
  228 + zoneOptions:[],
219 229 warehouseOptions: [],
220 230 rolesOptions: [],
221 231 nextDepartOptions: [],
... ... @@ -227,6 +237,7 @@ export default {
227 237 this.initRoleList()
228 238 this.initWarehouseList()
229 239 this.initTenantList()
  240 + this.initZoneList()
230 241 },
231 242 computed: {
232 243 uploadAction: function () {
... ... @@ -244,7 +255,7 @@ export default {
244 255 //根据屏幕宽度自适应抽屉宽度
245 256 this.resetScreenSize();
246 257 that.userId = record.id;
247   - that.model = Object.assign({}, {selectedRoles: '', selectedWarehouse: '',selecteddeparts: ''}, record);
  258 + that.model = Object.assign({}, {selectedRoles: '', selectedWarehouse: '',selecteddeparts: '', selectedZoneCode: ''}, record);
248 259 //身份为上级显示负责部门,否则不显示
249 260 if (this.model.userIdentity == 2) {
250 261 this.departIdShow = true;
... ... @@ -315,6 +326,17 @@ export default {
315 326 }
316 327 });
317 328 },
  329 + initZoneList() {
  330 + getAllZoneList().then((res) => {
  331 + if (res.success) {
  332 + this.zoneOptions = res.result.map((item, index, arr) => {
  333 + let c = {label: item.name, value: item.code}
  334 + return c;
  335 + })
  336 + console.log('this.zoneOptions: ', this.zoneOptions)
  337 + }
  338 + });
  339 + },
318 340 getWarehouse(userid) {
319 341 queryWarehouse({userid: userid}).then((res) => {
320 342 if (res.success) {
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
... ... @@ -172,6 +172,7 @@ public class SysUserController {
172 172 Result<SysUser> result = new Result<SysUser>();
173 173 String selectedRoles = jsonObject.getString("selectedRoles");
174 174 String selectedWarehouse = jsonObject.getString("selectedWarehouse");
  175 + String selectedZoneCode = jsonObject.getString("selectedZoneCode");
175 176 String selectedDeparts = jsonObject.getString("selecteddeparts");
176 177 try {
177 178 SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class);
... ... @@ -186,7 +187,7 @@ public class SysUserController {
186 187 throw new ServiceException("仓库不能为空");
187 188 }
188 189 // 保存用户走一个service 保证事务
189   - sysUserService.saveUser(user, selectedRoles, selectedDeparts, selectedWarehouse);
  190 + sysUserService.saveUser(user, selectedRoles, selectedDeparts, selectedWarehouse, selectedZoneCode);
190 191 result.success("添加成功!");
191 192 } catch (Exception e) {
192 193 log.error(e.getMessage(), e);
... ... @@ -213,6 +214,7 @@ public class SysUserController {
213 214 user.setPassword(sysUser.getPassword());
214 215 String roles = jsonObject.getString("selectedRoles");
215 216 String selectedWarehouse = jsonObject.getString("selectedWarehouse");
  217 + String selectedZoneCode = jsonObject.getString("selectedZoneCode");
216 218 String departs = jsonObject.getString("selecteddeparts");
217 219 if (oConvertUtils.isEmpty(departs)) {
218 220 // vue3.0前端只传递了departIds
... ... @@ -222,7 +224,7 @@ public class SysUserController {
222 224 throw new ServiceException("仓库不能为空");
223 225 }
224 226 // 修改用户走一个service 保证事务
225   - sysUserService.editUser(user, roles, departs, selectedWarehouse);
  227 + sysUserService.editUser(user, roles, departs, selectedWarehouse, selectedZoneCode);
226 228 result.success("修改成功!");
227 229 }
228 230 } catch (Exception e) {
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/system/entity/SysUser.java
... ... @@ -193,14 +193,30 @@ public class SysUser implements Serializable {
193 193  
194 194 /** 设备id uniapp推送用 */
195 195 private String clientId;
196   -
  196 +
  197 + /** 所属库区 **/
  198 + private String zoneCode;
  199 +
197 200 @TableField(exist = false)
198 201 private List<String> selectedWarehouses;
199   -
  202 +
200 203 public void setSelectedWarehouse(String selectedWarehouse) {
201 204 if (!StringUtils.isEmpty(selectedWarehouse)) {
202 205 this.selectedWarehouse = selectedWarehouse;
203 206 this.selectedWarehouses = Arrays.asList(selectedWarehouse.split(","));
204 207 }
205 208 }
  209 +
  210 + @TableField(exist = false)
  211 + private List<String> zoneCodes;
  212 +
  213 + public void setZoneCode(String zoneCode) {
  214 + if (!StringUtils.isEmpty(zoneCode)) {
  215 + this.zoneCode = zoneCode;
  216 + this.zoneCodes = Arrays.asList(zoneCode.split(","));
  217 + } else {
  218 + this.zoneCode = zoneCode;
  219 + }
  220 + }
  221 +
206 222 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/system/service/ISysUserService.java
... ... @@ -231,7 +231,7 @@ public interface ISysUserService extends IService&lt;SysUser&gt; {
231 231 * @param selectedRoles 选择的角色id,多个以逗号隔开
232 232 * @param selectedDeparts 选择的部门id,多个以逗号隔开
233 233 */
234   - void saveUser(SysUser user, String selectedRoles, String selectedDeparts, String selectedWarehouse);
  234 + void saveUser(SysUser user, String selectedRoles, String selectedDeparts, String selectedWarehouse, String selectedZoneCode);
235 235  
236 236 /**
237 237 * 编辑用户
... ... @@ -239,7 +239,7 @@ public interface ISysUserService extends IService&lt;SysUser&gt; {
239 239 * @param roles 选择的角色id,多个以逗号隔开
240 240 * @param departs 选择的部门id,多个以逗号隔开
241 241 */
242   - void editUser(SysUser user, String roles, String departs, String selectedWarehouse);
  242 + void editUser(SysUser user, String roles, String departs, String selectedWarehouse, String selectedZoneCode);
243 243  
244 244 /** userId转为username */
245 245 List<String> userIdToUsername(Collection<String> userIdList);
... ... @@ -251,4 +251,5 @@ public interface ISysUserService extends IService&lt;SysUser&gt; {
251 251 */
252 252 public List<Map<String, Object>> getWarehouseByUserCode(String userCode);
253 253  
  254 + public SysUser getUserByRealName(String realName);
254 255 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
... ... @@ -23,10 +23,10 @@ import org.jeecg.modules.system.service.ISysUserService;
23 23 import org.jeecg.modules.system.vo.SysUserDepVo;
24 24 import org.jeecg.modules.wms.config.sysUserWarehouse.entity.SysUserWarehouse;
25 25 import org.jeecg.modules.wms.config.sysUserWarehouse.service.ISysUserWarehouseService;
26   -import org.jeecg.modules.wms.config.warehouse.entity.Warehouse;
27 26 import org.jeecg.modules.wms.config.warehouse.service.IWarehouseService;
28 27 import org.jeecg.utils.HuahengJwtUtil;
29 28 import org.jeecg.utils.StringUtils;
  29 +import org.jeecg.utils.constant.QuantityConstant;
30 30 import org.springframework.beans.factory.annotation.Autowired;
31 31 import org.springframework.cache.annotation.CacheEvict;
32 32 import org.springframework.stereotype.Service;
... ... @@ -489,7 +489,7 @@ public class SysUserServiceImpl extends ServiceImpl&lt;SysUserMapper, SysUser&gt; impl
489 489  
490 490 @Override
491 491 @Transactional(rollbackFor = Exception.class)
492   - public void saveUser(SysUser user, String selectedRoles, String selectedDeparts, String selectedWarehouse) {
  492 + public void saveUser(SysUser user, String selectedRoles, String selectedDeparts, String selectedWarehouse, String selectedZoneCode) {
493 493 // step.1 保存用户
494 494 this.save(user);
495 495 // step.2 保存角色
... ... @@ -520,12 +520,20 @@ public class SysUserServiceImpl extends ServiceImpl&lt;SysUserMapper, SysUser&gt; impl
520 520 }
521 521 }
522 522 }
  523 +
  524 + SysUser sysUser = new SysUser();
  525 + sysUser.setId(user.getId());
  526 + sysUser.setZoneCode(selectedZoneCode);
  527 + if (!sysUserService.updateById(sysUser)) {
  528 + throw new JeecgBootException("更新用户库区失败");
  529 + }
  530 +
523 531 }
524 532  
525 533 @Override
526 534 @Transactional(rollbackFor = Exception.class)
527 535 @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true)
528   - public void editUser(SysUser user, String roles, String departs, String selectedWarehouse) {
  536 + public void editUser(SysUser user, String roles, String departs, String selectedWarehouse, String selectedZoneCode) {
529 537 // step.1 修改用户基础信息
530 538 this.updateById(user);
531 539 // step.2 修改角色
... ... @@ -593,6 +601,17 @@ public class SysUserServiceImpl extends ServiceImpl&lt;SysUserMapper, SysUser&gt; impl
593 601 }
594 602 }
595 603 }
  604 +
  605 + SysUser sysUser = new SysUser();
  606 + sysUser.setId(user.getId());
  607 + if (StringUtils.isEmpty(selectedZoneCode)) {
  608 + sysUser.setZoneCode(QuantityConstant.EMPTY_STRING);
  609 + } else {
  610 + sysUser.setZoneCode(selectedZoneCode);
  611 + }
  612 + if (!sysUserService.updateById(sysUser)) {
  613 + throw new JeecgBootException("更新用户库区失败");
  614 + }
596 615 }
597 616  
598 617 @Override
... ... @@ -617,4 +636,12 @@ public class SysUserServiceImpl extends ServiceImpl&lt;SysUserMapper, SysUser&gt; impl
617 636 return userMapper.getWarehouseByUserName(username);
618 637 }
619 638  
  639 + @Override
  640 + public SysUser getUserByRealName(String realName) {
  641 + LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = Wrappers.lambdaQuery();
  642 + sysUserLambdaQueryWrapper.eq(SysUser::getRealname, realName);
  643 + SysUser sysUser = getOne(sysUserLambdaQueryWrapper);
  644 + return sysUser;
  645 + }
  646 +
620 647 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/zone/controller/ZoneController.java
... ... @@ -2,45 +2,36 @@ package org.jeecg.modules.wms.config.zone.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 +
  6 +import javax.annotation.Resource;
10 7 import javax.servlet.http.HttpServletRequest;
11 8 import javax.servlet.http.HttpServletResponse;
12 9  
13   -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
14   -import com.baomidou.mybatisplus.core.toolkit.Wrappers;
15 10 import org.apache.shiro.authz.annotation.RequiresPermissions;
16 11 import org.jeecg.common.api.vo.Result;
  12 +import org.jeecg.common.aspect.annotation.AutoLog;
  13 +import org.jeecg.common.system.base.controller.JeecgController;
17 14 import org.jeecg.common.system.query.QueryGenerator;
18   -import org.jeecg.utils.HuahengJwtUtil;
19   -import org.jeecg.common.util.oConvertUtils;
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   -
  15 +import org.jeecg.modules.system.entity.SysUser;
  16 +import org.jeecg.modules.system.service.ISysUserService;
26 17 import org.jeecg.modules.wms.config.zone.entity.Zone;
27 18 import org.jeecg.modules.wms.config.zone.service.IZoneService;
  19 +import org.jeecg.utils.HuahengJwtUtil;
28 20 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 21 import org.springframework.beans.factory.annotation.Autowired;
36 22 import org.springframework.web.bind.annotation.*;
37   -import org.springframework.web.multipart.MultipartFile;
38   -import org.springframework.web.multipart.MultipartHttpServletRequest;
39 23 import org.springframework.web.servlet.ModelAndView;
40   -import com.alibaba.fastjson.JSON;
  24 +
  25 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  26 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  27 +import com.baomidou.mybatisplus.core.metadata.IPage;
  28 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  29 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  30 +
  31 +import cn.hutool.core.util.StrUtil;
41 32 import io.swagger.annotations.Api;
42 33 import io.swagger.annotations.ApiOperation;
43   -import org.jeecg.common.aspect.annotation.AutoLog;
  34 +import lombok.extern.slf4j.Slf4j;
44 35  
45 36 /**
46 37 * @Description: 库区管理
... ... @@ -56,6 +47,9 @@ public class ZoneController extends JeecgController&lt;Zone, IZoneService&gt; {
56 47 @Autowired
57 48 private IZoneService zoneService;
58 49  
  50 + @Resource
  51 + private ISysUserService sysUserService;
  52 +
59 53 /**
60 54 * 分页列表查询
61 55 * @param zone
... ... @@ -180,7 +174,23 @@ public class ZoneController extends JeecgController&lt;Zone, IZoneService&gt; {
180 174 public Result<?> getZoneList(HttpServletRequest req) {
181 175 LambdaQueryWrapper<Zone> zoneLambdaQueryWrapper = Wrappers.lambdaQuery();
182 176 HuahengJwtUtil.setWarehouseCode(zoneLambdaQueryWrapper, Zone.class, req);
  177 + String realName = HuahengJwtUtil.getCurrentOperator();
  178 + if (StringUtils.isNotEmpty(realName)) {
  179 + SysUser sysUser = sysUserService.getUserByRealName(realName);
  180 + if (StringUtils.isNotEmpty(sysUser.getZoneCode())) {
  181 + zoneLambdaQueryWrapper.in(Zone::getCode, Arrays.asList(sysUser.getZoneCode().split(StrUtil.COMMA)));
  182 + }
  183 + }
183 184 List<Zone> zoneList = zoneService.list(zoneLambdaQueryWrapper);
184 185 return Result.OK(zoneList);
185 186 }
  187 +
  188 + @RequestMapping(value = "/getAllZoneList", method = RequestMethod.GET)
  189 + public Result<List<Zone>> getAllZoneList() {
  190 + Result<List<Zone>> result = new Result<>();
  191 + List<Zone> list = zoneService.getAllZoneList();
  192 + result.setResult(list);
  193 + result.setSuccess(true);
  194 + return result;
  195 + }
186 196 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/zone/service/IZoneService.java
1 1 package org.jeecg.modules.wms.config.zone.service;
2 2  
3   -import com.baomidou.mybatisplus.extension.service.IService;
4   -import org.jeecg.modules.wms.config.location.entity.Location;
  3 +import java.util.List;
  4 +
5 5 import org.jeecg.modules.wms.config.zone.entity.Zone;
6 6  
  7 +import com.baomidou.mybatisplus.extension.service.IService;
  8 +
7 9 /**
8 10 * @Description: 库区管理
9 11 * @Author: jeecg-boot
... ... @@ -13,4 +15,6 @@ import org.jeecg.modules.wms.config.zone.entity.Zone;
13 15 public interface IZoneService extends IService<Zone> {
14 16  
15 17 Zone getZoneByCode(String zoneCode, String wareohuseCode);
  18 +
  19 + public List<Zone> getAllZoneList();
16 20 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/zone/service/impl/ZoneServiceImpl.java
1 1 package org.jeecg.modules.wms.config.zone.service.impl;
2 2  
3   -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4   -import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  3 +import java.util.List;
  4 +
5 5 import org.jeecg.modules.wms.config.zone.entity.Zone;
6 6 import org.jeecg.modules.wms.config.zone.mapper.ZoneMapper;
7 7 import org.jeecg.modules.wms.config.zone.service.IZoneService;
8 8 import org.springframework.stereotype.Service;
9 9  
  10 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  11 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
10 12 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
11 13  
12 14 /**
... ... @@ -25,4 +27,9 @@ public class ZoneServiceImpl extends ServiceImpl&lt;ZoneMapper, Zone&gt; implements IZ
25 27 Zone zone = getOne(zoneLambdaQueryWrapper);
26 28 return zone;
27 29 }
  30 +
  31 + @Override
  32 + public List<Zone> getAllZoneList() {
  33 + return list();
  34 + }
28 35 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/controller/InventoryHeaderController.java
... ... @@ -6,6 +6,7 @@ import java.util.List;
6 6 import java.util.Map;
7 7 import java.util.stream.Collectors;
8 8  
  9 +import javax.annotation.Resource;
9 10 import javax.servlet.http.HttpServletRequest;
10 11 import javax.servlet.http.HttpServletResponse;
11 12  
... ... @@ -17,11 +18,14 @@ import org.jeecg.common.system.base.controller.JeecgController;
17 18 import org.jeecg.common.system.query.QueryGenerator;
18 19 import org.jeecg.common.system.vo.LoginUser;
19 20 import org.jeecg.common.util.oConvertUtils;
  21 +import org.jeecg.modules.system.entity.SysUser;
  22 +import org.jeecg.modules.system.service.ISysUserService;
20 23 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
21 24 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader;
22 25 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
23 26 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService;
24 27 import org.jeecg.utils.HuahengJwtUtil;
  28 +import org.jeecg.utils.StringUtils;
25 29 import org.jeecg.utils.constant.QuantityConstant;
26 30 import org.jeecgframework.poi.excel.ExcelImportUtil;
27 31 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
... ... @@ -29,21 +33,15 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
29 33 import org.jeecgframework.poi.excel.entity.ImportParams;
30 34 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
31 35 import org.springframework.beans.factory.annotation.Autowired;
32   -import org.springframework.web.bind.annotation.DeleteMapping;
33   -import org.springframework.web.bind.annotation.GetMapping;
34   -import org.springframework.web.bind.annotation.PathVariable;
35   -import org.springframework.web.bind.annotation.PostMapping;
36   -import org.springframework.web.bind.annotation.RequestBody;
37   -import org.springframework.web.bind.annotation.RequestMapping;
38   -import org.springframework.web.bind.annotation.RequestMethod;
39   -import org.springframework.web.bind.annotation.RequestParam;
40   -import org.springframework.web.bind.annotation.RestController;
  36 +import org.springframework.web.bind.annotation.*;
41 37 import org.springframework.web.multipart.MultipartFile;
42 38 import org.springframework.web.multipart.MultipartHttpServletRequest;
43 39 import org.springframework.web.servlet.ModelAndView;
44 40  
  41 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
45 42 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
46 43 import com.baomidou.mybatisplus.core.metadata.IPage;
  44 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
47 45 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
48 46  
49 47 import io.swagger.annotations.Api;
... ... @@ -68,6 +66,8 @@ public class InventoryHeaderController extends JeecgController&lt;InventoryHeader,
68 66 @Autowired
69 67 private IInventoryDetailService inventoryDetailService;
70 68  
  69 + @Resource
  70 + private ISysUserService sysUserService;
71 71 /*---------------------------------主表处理-begin-------------------------------------*/
72 72  
73 73 /**
... ... @@ -84,9 +84,24 @@ public class InventoryHeaderController extends JeecgController&lt;InventoryHeader,
84 84 public Result<IPage<InventoryHeader>> queryPageList(InventoryHeader inventoryHeader, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
85 85 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
86 86 HuahengJwtUtil.setWarehouseCode(req, inventoryHeader);
  87 + String realName = HuahengJwtUtil.getCurrentOperator();
  88 + String inventoryHeaderZoneCode = inventoryHeader.getZoneCode();
  89 + LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery();
87 90 QueryWrapper<InventoryHeader> queryWrapper = QueryGenerator.initQueryWrapper(inventoryHeader, req.getParameterMap());
88 91 Page<InventoryHeader> page = new Page<InventoryHeader>(pageNo, pageSize);
89 92 IPage<InventoryHeader> pageList = inventoryHeaderService.page(page, queryWrapper);
  93 + if (StringUtils.isEmpty(inventoryHeaderZoneCode)) {
  94 + if (StringUtils.isNotEmpty(realName)) {
  95 + SysUser sysUser = sysUserService.getUserByRealName(realName);
  96 + if (sysUser != null) {
  97 + String zoneCode = sysUser.getZoneCode();
  98 + if (StringUtils.isNotEmpty(zoneCode)) {
  99 + String[] zoneCodes = zoneCode.split(",");
  100 + inventoryHeaderLambdaQueryWrapper.in(InventoryHeader::getZoneCode, Arrays.asList(zoneCodes));
  101 + }
  102 + }
  103 + }
  104 + }
90 105 return Result.OK(pageList);
91 106 }
92 107  
... ... @@ -235,7 +250,7 @@ public class InventoryHeaderController extends JeecgController&lt;InventoryHeader,
235 250 this.inventoryDetailService.removeByIds(Arrays.asList(ids.split(",")));
236 251 return Result.OK("批量删除成功!");
237 252 }
238   -
  253 +
239 254 /**
240 255 * 导出
241 256 * @return
... ...