张涛 1 year ago
parent
commit
abc00906a2

+ 24
- 4
application/src/main/java/com/lyg/application/controller/TaRotationController.java View File

113
 
113
 
114
         String specificOrgNum = taRotation.getSpecificOrgName();//轮岗前具体单位名称 传来的是orgId
114
         String specificOrgNum = taRotation.getSpecificOrgName();//轮岗前具体单位名称 传来的是orgId
115
 //        String specificOrgNum = taRotation.getSpecificOrgNum();//轮岗前单位号
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
         String specificOrgName = sysOrgMapper.getOrgId(specificOrgNum);
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
         taRotationService.save(taRotation);
128
         taRotationService.save(taRotation);
122
         Object result = rule.taRotationRule(taRotation);
129
         Object result = rule.taRotationRule(taRotation);
123
 
130
 
136
     @PutMapping("/taRotation/{id}")
143
     @PutMapping("/taRotation/{id}")
137
     public SaResult edit(@ApiParam("对象实体") @Validated @RequestBody TaRotation taRotation,
144
     public SaResult edit(@ApiParam("对象实体") @Validated @RequestBody TaRotation taRotation,
138
                          @ApiParam("对象ID") @PathVariable String id) throws Exception {
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
         taRotation.setRotationId(id);
159
         taRotation.setRotationId(id);
140
         taRotationService.updateById(taRotation);
160
         taRotationService.updateById(taRotation);
141
         Object result = rule.taRotationRule(taRotation);
161
         Object result = rule.taRotationRule(taRotation);

+ 17
- 0
system/src/main/java/com/lyg/system/controller/BaseController.java View File

6
 import com.lyg.system.entity.SysUser;
6
 import com.lyg.system.entity.SysUser;
7
 import com.lyg.system.service.SysUserService;
7
 import com.lyg.system.service.SysUserService;
8
 import com.lyg.system.service.request.Fetch;
8
 import com.lyg.system.service.request.Fetch;
9
+import lombok.SneakyThrows;
9
 import org.springframework.beans.factory.annotation.Autowired;
10
 import org.springframework.beans.factory.annotation.Autowired;
10
 import org.springframework.stereotype.Component;
11
 import org.springframework.stereotype.Component;
11
 
12
 
25
     @Resource
26
     @Resource
26
     HttpServletRequest request;
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
      *