张涛 1 gadu atpakaļ
vecāks
revīzija
abc00906a2

+ 24
- 4
application/src/main/java/com/lyg/application/controller/TaRotationController.java Parādīt failu

@@ -113,11 +113,18 @@ public class TaRotationController extends BaseController {
113 113
 
114 114
         String specificOrgNum = taRotation.getSpecificOrgName();//轮岗前具体单位名称 传来的是orgId
115 115
 //        String specificOrgNum = taRotation.getSpecificOrgNum();//轮岗前单位号
116
-        String specificNameOrgRotation = taRotation.getSpecificNameOrgRotation();//轮岗后具体单位名称
117
-        String orgNumJobRotation = taRotation.getOrgNumJobRotation();//轮岗后单位号
116
+        String OrgRotationId = taRotation.getSpecificNameOrgRotation();//轮岗后具体单位名称 传来的是orgId
117
+//        String orgNumJobRotation = taRotation.getOrgNumJobRotation();//轮岗后单位号
118
+
118 119
         String specificOrgName = sysOrgMapper.getOrgId(specificOrgNum);
119
-        taRotation.setSpecificOrgNum(specificOrgName);
120
-        taRotation.setSpecificOrgName();
120
+        taRotation.setSpecificOrgNum(specificOrgNum);
121
+        taRotation.setSpecificOrgName(specificOrgName);
122
+
123
+        String orgNameJobRotation = sysOrgMapper.getOrgId(OrgRotationId);
124
+        taRotation.setOrgNumJobRotation(OrgRotationId);
125
+        taRotation.setSpecificNameOrgRotation(orgNameJobRotation);
126
+
127
+
121 128
         taRotationService.save(taRotation);
122 129
         Object result = rule.taRotationRule(taRotation);
123 130
 
@@ -136,6 +143,19 @@ public class TaRotationController extends BaseController {
136 143
     @PutMapping("/taRotation/{id}")
137 144
     public SaResult edit(@ApiParam("对象实体") @Validated @RequestBody TaRotation taRotation,
138 145
                          @ApiParam("对象ID") @PathVariable String id) throws Exception {
146
+        String specificOrgNum = taRotation.getSpecificOrgName();//轮岗前具体单位名称 传来的是orgId
147
+//        String specificOrgNum = taRotation.getSpecificOrgNum();//轮岗前单位号
148
+        String OrgRotationId = taRotation.getSpecificNameOrgRotation();//轮岗后具体单位名称 传来的是orgId
149
+//        String orgNumJobRotation = taRotation.getOrgNumJobRotation();//轮岗后单位号
150
+
151
+        String specificOrgName = sysOrgMapper.getOrgId(specificOrgNum);
152
+        taRotation.setSpecificOrgNum(specificOrgNum);
153
+        taRotation.setSpecificOrgName(specificOrgName);
154
+
155
+        String orgNameJobRotation = sysOrgMapper.getOrgId(OrgRotationId);
156
+        taRotation.setOrgNumJobRotation(OrgRotationId);
157
+        taRotation.setSpecificNameOrgRotation(orgNameJobRotation);
158
+
139 159
         taRotation.setRotationId(id);
140 160
         taRotationService.updateById(taRotation);
141 161
         Object result = rule.taRotationRule(taRotation);

+ 17
- 0
system/src/main/java/com/lyg/system/controller/BaseController.java Parādīt failu

@@ -6,6 +6,7 @@ import com.lyg.common.util.StringUtil;
6 6
 import com.lyg.system.entity.SysUser;
7 7
 import com.lyg.system.service.SysUserService;
8 8
 import com.lyg.system.service.request.Fetch;
9
+import lombok.SneakyThrows;
9 10
 import org.springframework.beans.factory.annotation.Autowired;
10 11
 import org.springframework.stereotype.Component;
11 12
 
@@ -25,6 +26,22 @@ public class BaseController {
25 26
     @Resource
26 27
     HttpServletRequest request;
27 28
 
29
+    /**
30
+     * 数据权限校验
31
+     */
32
+
33
+    @SneakyThrows
34
+    public void checkAuth() {
35
+        SysUser sysUser = currentUser();
36
+        Integer isAdmin = sysUser.getIsAdmin();
37
+        if (isAdmin.equals(1)){
38
+            //是超级管理员
39
+        }else{
40
+//            不是管理员
41
+        }
42
+
43
+    }
44
+
28 45
     /**
29 46
      * 获取当前用户
30 47
      *