Browse Source

完善学校模块

tags/正式3.14.0
王宁 4 months ago
parent
commit
dcf129c867

+ 12
- 5
sapi/src/main/java/com/xhkjedu/sapi/service/system/ModuleService.java View File

1
 package com.xhkjedu.sapi.service.system;
1
 package com.xhkjedu.sapi.service.system;
2
 
2
 
3
 import com.xhkjedu.sapi.mapper.system.ModuleMapper;
3
 import com.xhkjedu.sapi.mapper.system.ModuleMapper;
4
+import com.xhkjedu.sapi.mapper.system.ModuledefaultMapper;
4
 import com.xhkjedu.sapi.mapper.system.RoleModuleMapper;
5
 import com.xhkjedu.sapi.mapper.system.RoleModuleMapper;
5
 import com.xhkjedu.sapi.model.system.TModule;
6
 import com.xhkjedu.sapi.model.system.TModule;
7
+import com.xhkjedu.sapi.model.system.TModuledefault;
6
 import com.xhkjedu.sapi.model.system.TRoleModule;
8
 import com.xhkjedu.sapi.model.system.TRoleModule;
7
 import com.xhkjedu.sapi.utils.ApiUtil;
9
 import com.xhkjedu.sapi.utils.ApiUtil;
8
 import com.xhkjedu.sapi.vo.system.ModuleSelVo;
10
 import com.xhkjedu.sapi.vo.system.ModuleSelVo;
11
 import org.springframework.stereotype.Service;
13
 import org.springframework.stereotype.Service;
12
 import org.springframework.transaction.annotation.Transactional;
14
 import org.springframework.transaction.annotation.Transactional;
13
 
15
 
16
+import javax.annotation.Resource;
14
 import java.util.ArrayList;
17
 import java.util.ArrayList;
15
 import java.util.List;
18
 import java.util.List;
16
 import java.util.Map;
19
 import java.util.Map;
27
     private ModuleMapper moduleMapper;
30
     private ModuleMapper moduleMapper;
28
     @Autowired
31
     @Autowired
29
     private RoleModuleMapper roleModuleMapper;
32
     private RoleModuleMapper roleModuleMapper;
33
+    @Resource
34
+    private ModuledefaultMapper moduledefaultMapper;
30
 
35
 
31
     /**
36
     /**
32
      *功能描述 添加
37
      *功能描述 添加
72
      */
77
      */
73
     public Integer update(TModule module){
78
     public Integer update(TModule module){
74
         TModule original=moduleMapper.selectByPrimaryKey(module.getModuleid());
79
         TModule original=moduleMapper.selectByPrimaryKey(module.getModuleid());
75
-        if(original!=null && original.getSourcetype() ==2){
76
-            module.setDefaultbcode(module.getBelongcode());
77
 
80
 
78
-            //判断是否更改belongcode
79
-            if(module != null && !original.getBelongcode().equals(module.getBelongcode())){
81
+        if(original!=null && original.getSourcetype() == 1 && original.getLevel() == 2 && N_Utils.isNotEmpty(original.getDefaultid())){
82
+            //说明是区域创建模块,判断区域模块belongcode,
83
+            TModuledefault moduledefault = moduledefaultMapper.selectByPrimaryKey(original.getDefaultid());
84
+            if(moduledefault!=null && moduledefault.getBelongcode() == 3 && !original.getBelongcode().equals(module.getBelongcode())){
85
+                //区域模块,区域模块为3,则学校可以自行修改
80
                 moduleMapper.updateBelongcodeByModuleid(module);
86
                 moduleMapper.updateBelongcodeByModuleid(module);
87
+            }else{
88
+                module.setBelongcode(null);
81
             }
89
             }
82
-
83
         }
90
         }
84
 
91
 
85
         return moduleMapper.updateByPrimaryKeySelective(module);
92
         return moduleMapper.updateByPrimaryKeySelective(module);

Loading…
Cancel
Save