Ver código fonte

修正 护理技能大赛缺陷

单文琦 2 anos atrás
pai
commit
fda508bafd

+ 3 - 3
ruoyi-modules/mz-business-hljnds/src/main/java/com/ruoyi/business/service/impl/ZwywHldsXsxxServiceImpl.java

@@ -50,9 +50,6 @@ public class ZwywHldsXsxxServiceImpl implements IZwywHldsXsxxService
         ZwywHldsXsxx res = zwywHldsXsxxMapper.selectById(id);
         SysHljndsSqwh sysHljndsSqwh = sysHljndsSqwhMapper.selectById(res.getSqwhId());
         res.setMc(sysHljndsSqwh.getMc());
-        if (!res.getCreateUserId().equals(String.valueOf(SecurityUtils.getUserId()))){
-            throw  new ServiceException("只允许维护自己创建的数据");
-        }
         res.setSqMc(sysDeptJlMapper.getXzqhNames(res.getSq()));
         res.setSq(sysDeptJlMapper.getXzqhCodes(res.getSq()));
         return res;
@@ -112,6 +109,9 @@ public class ZwywHldsXsxxServiceImpl implements IZwywHldsXsxxService
     @Override
     public int updateZwywHldsXsxx(ZwywHldsXsxx zwywHldsXsxx)
     {
+        if (!zwywHldsXsxx.getCreateUserId().equals(String.valueOf(SecurityUtils.getUserId()))){
+            throw  new ServiceException("只允许维护自己创建的数据");
+        }
         return zwywHldsXsxxMapper.updateById(zwywHldsXsxx);
     }
 

+ 6 - 0
ruoyi-modules/mz-business/src/main/java/com/ruoyi/business/mapper/ZwywZhjgBzssqkMapper.java

@@ -1,6 +1,8 @@
 package com.ruoyi.business.mapper;
 
 import com.ruoyi.business.domain.ZwywZhjgBzssqk;
+import com.ruoyi.common.datascope.handler.DataColumn;
+import com.ruoyi.common.datascope.handler.DataPermission;
 import com.ruoyi.common.datascope.utils.BaseMapperPlus;
 
 import java.util.List;
@@ -11,6 +13,10 @@ import java.util.List;
  * @author ruoyi
  * @date 2022-09-16
  */
+@DataPermission({
+        @DataColumn(key = "deptName", value = "create_unit"),
+        @DataColumn(key = "xzqhName", value = "create_area_code")
+})
 public interface ZwywZhjgBzssqkMapper extends BaseMapperPlus<ZwywZhjgBzssqk> {
 
     public List<ZwywZhjgBzssqk> selectZwywZhjgBzssqkList (ZwywZhjgBzssqk zwywZhjgBzssqk);