hexiao 2 yıl önce
ebeveyn
işleme
a71e9677e4

+ 2 - 1
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseNoticeController.java

@@ -16,6 +16,7 @@ import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.core.domain.entity.SysDept;
 import com.ozs.common.core.domain.entity.SysRole;
+import com.ozs.common.core.domain.entity.SysUser;
 import com.ozs.common.enums.BusinessType;
 import com.ozs.plan.doman.MonthlyReconciliation;
 import com.ozs.system.service.ISysDeptService;
@@ -149,7 +150,7 @@ public class BaseNoticeController extends BaseController {
     @Log(title = ModularConstans.notice, businessType = BusinessType.QUERY)
     public AjaxResult homePage(@NotEmpty(message = "数据为空")
                            @RequestBody BaseNoticePageReqVo vo) {
-        vo.setUserId(getUserId());
+        vo.setIsAdmin(SysUser.isAdmin(getUserId()));
         vo.setDeptId(getDeptId());
         vo.setRoleFlay(false);
         // 添加数据权限

+ 2 - 1
purchase-admin/src/main/java/com/ozs/web/controller/plan/MonthlyReconciliationController.java

@@ -13,6 +13,7 @@ import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.core.domain.entity.SysDept;
 import com.ozs.common.core.domain.entity.SysDictData;
 import com.ozs.common.core.domain.entity.SysRole;
+import com.ozs.common.core.domain.entity.SysUser;
 import com.ozs.common.enums.BusinessType;
 import com.ozs.common.enums.SysFileRefEnum;
 import com.ozs.plan.doman.MonthlyReconciliation;
@@ -64,7 +65,7 @@ public class MonthlyReconciliationController extends BaseController {
     public AjaxResult page(@NotEmpty(message = "数据为空")
                            @RequestBody MonthlyReconciliationPageReqVo vo) {
         vo.setDeptId(getDeptId());
-        vo.setUserId(getUserId());
+        vo.setIsAdmin(SysUser.isAdmin(getUserId()));
         vo.setRoleFlay(false);
         // 添加数据权限
         List<String> roleKeys = getLoginUser().getUser().getRoles().stream().map(SysRole::getRoleKey).collect(Collectors.toList());

+ 1 - 1
purchase-system/src/main/java/com/ozs/base/mapper/BaseNoticeMapper.java

@@ -23,7 +23,7 @@ public interface BaseNoticeMapper extends BaseMapper<BaseNotice> {
             " base_notice b left join pm_audit_dept_ref r " +
             " on b.demand_id = r.ref_id  " +
             "  left join pm_demand p on  b.demand_id = p.demand_id " +
-            " where ( (#{userId} = 1 or #{userId} = -1 ) " +
+            " where ( #{isAdmin} " +
             " or if(#{roleFlay},(r.dept_id = #{deptId} and  r.ref_type = 1), p.purchase_dept_id = #{deptId}  ) " +
             " )" +
             " and (#{noticeName} is null  or   b.name like concat('%',#{noticeName},'%'))  " +

+ 1 - 1
purchase-system/src/main/java/com/ozs/base/vo/BaseNoticePageReqVo.java

@@ -42,7 +42,7 @@ public class BaseNoticePageReqVo extends PageVo {
 
     private Long deptId;
 
-    private Long userId;
+    private Boolean isAdmin;
 
     private boolean roleFlay;
 

+ 1 - 1
purchase-system/src/main/java/com/ozs/plan/doman/vo/requestVo/MonthlyReconciliationPageReqVo.java

@@ -39,7 +39,7 @@ public class MonthlyReconciliationPageReqVo extends PageVo {
 
     private Long deptId;
 
-    private Long userId;
+    private Boolean isAdmin;
 
     public Boolean roleFlay;
 }

+ 1 - 1
purchase-system/src/main/java/com/ozs/plan/mapper/MonthlyReconciliationMapper.java

@@ -16,7 +16,7 @@ public interface MonthlyReconciliationMapper extends BaseMapper<MonthlyReconcili
     @Select("select p.* from " +
             " pm_demand p left join plan_practical pp on p.plan_id = pp.plan_practical_id" +
             " left join pm_audit_dept_ref r  on pp.plan_practical_id = r.ref_id   " +
-            " where ( (#{userId} = 1 or #{userId} = -1) " +
+            " where ( #{isAdmin} " +
             " or if(#{roleFlay},(r.dept_id = #{deptId} and  r.ref_type = 1), p.purchase_dept_id = #{deptId}  ) " +
             " )" +
             " and (#{projectName} is null  or   p.project_name like concat('%',#{projectName},'%'))  " +