فهرست منبع

APP库存查询分页、外部权限BUG修正

Sun 3 سال پیش
والد
کامیت
7f44da4380

+ 2 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWhgenlegController.java

@@ -253,9 +253,8 @@ public class TWhgenlegController extends BaseController {
      */
     //@DataScope(deptAlias = "d", userAlias = "u")
     @GetMapping("/appWhGenLegList")
-    public TableDataInfo appWhGenLegList(TWhgenleg tWhgenleg) {
-        startPage();
-        List<Map<String, Object>> list = tWhgenlegService.appWhGenLegList(tWhgenleg);
+    public TableDataInfo appWhGenLegList(TWhgenleg tWhgenleg, Integer pageNum, Integer pageSize) {
+        List<Map<String, Object>> list = tWhgenlegService.appWhGenLegList(tWhgenleg, pageNum, pageSize);
         return getDataTable(list);
     }
 

+ 1 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/ITWhgenlegService.java

@@ -148,7 +148,7 @@ public interface ITWhgenlegService {
      * @param tWhgenleg
      * @return
      */
-    public List<Map<String, Object>> appWhGenLegList(TWhgenleg tWhgenleg);
+    public List<Map<String, Object>> appWhGenLegList(TWhgenleg tWhgenleg, Integer pageNum, Integer pageSize);
 
     /**
      * 查询库存总帐详细信息

+ 10 - 7
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java

@@ -2,17 +2,21 @@ package com.ruoyi.reportManagement.service.impl;
 
 
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.github.pagehelper.PageHelper;
 import com.ruoyi.basicData.domain.TCustomerContact;
 import com.ruoyi.basicData.mapper.TCustomerContactMapper;
 import com.ruoyi.basicData.mapper.TWarehouseMapper;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
+import com.ruoyi.common.core.page.PageDomain;
+import com.ruoyi.common.core.page.TableSupport;
 import com.ruoyi.common.exception.WarehouseException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.DictUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.sql.SqlUtil;
 import com.ruoyi.reportManagement.domain.SingleAnalysisExcel;
 import com.ruoyi.reportManagement.domain.SingleAnalysisFeesExcel;
 import com.ruoyi.reportManagement.domain.TWhgenleg;
@@ -486,12 +490,11 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
     }
 
     @Override
-    public List<Map<String, Object>> appWhGenLegList(TWhgenleg tWhgenleg) {
-        List<Map<String, Object>> list;
+    public List<Map<String, Object>> appWhGenLegList(TWhgenleg tWhgenleg, Integer pageNum, Integer pageSize) {
         TCustomerContact customerContact = new TCustomerContact();
         SysUser user = SecurityUtils.getLoginUser().getUser();
         if ("外部用户".equals(user.getDept().getDeptName())) {
-            customerContact.setfTel(SecurityUtils.getLoginUser().getUser().getPhonenumber());
+            customerContact.setfTel(SecurityUtils.getLoginUser().getUser().getUserName());
             List<TCustomerContact> tCustomerContacts = customerContactMapper.selectTCustomerContactList(customerContact);
             if (CollectionUtils.isNotEmpty(tCustomerContacts)) {
                 tWhgenleg.setfCorpid(tCustomerContacts.get(0).getfPid());
@@ -506,11 +509,11 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
                 tWhgenleg.setfLocation(0L);
             }
         }
-        list = tWhgenlegMapper.selectInventoryMapList(tWhgenleg);
-        if ("admin".equals(SecurityUtils.getUsername())) {
-            list = tWhgenlegMapper.selectInventoryMapList(tWhgenleg);
+
+        if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
+            PageHelper.startPage(pageNum, pageSize);
         }
-        return list;
+        return tWhgenlegMapper.selectInventoryMapList(tWhgenleg);
     }
 
     /**