提交 3a642075 编写于 作者: zhouweidong's avatar zhouweidong

调整自定义查询

上级 d165d33b
...@@ -63,7 +63,6 @@ public class ClientAuthenticationResource ...@@ -63,7 +63,6 @@ public class ClientAuthenticationResource
setUserPermission(user); setUserPermission(user);
setUserOrgInfo(user); setUserOrgInfo(user);
} }
return ResponseEntity.ok().body(user); return ResponseEntity.ok().body(user);
} }
...@@ -77,7 +76,6 @@ public class ClientAuthenticationResource ...@@ -77,7 +76,6 @@ public class ClientAuthenticationResource
setUserPermission(user); setUserPermission(user);
setUserOrgInfo(user); setUserOrgInfo(user);
} }
return ResponseEntity.ok().body(user); return ResponseEntity.ok().body(user);
} }
...@@ -107,9 +105,9 @@ public class ClientAuthenticationResource ...@@ -107,9 +105,9 @@ public class ClientAuthenticationResource
"\t FROM\n" + "\t FROM\n" +
"\t IBZUSER_ROLE t LEFT JOIN IBZUSER t1 ON t.SYS_USERID=T1.USERID\n" + "\t IBZUSER_ROLE t LEFT JOIN IBZUSER t1 ON t.SYS_USERID=T1.USERID\n" +
"\t WHERE\n" + "\t WHERE\n" +
"\t T1.USERID = '%s'\n" + "\t T1.USERID = #{et.param0}\n" +
"\t)\n" + "\t)\n" +
"AND T1.PERMISSIONTYPE = '%s' "; "AND T1.PERMISSIONTYPE = #{et.param1} ";
...@@ -127,12 +125,21 @@ public class ClientAuthenticationResource ...@@ -127,12 +125,21 @@ public class ClientAuthenticationResource
"\t FROM\n" + "\t FROM\n" +
"\t IBZUSER_ROLE t LEFT JOIN IBZUSER t1 ON t.SYS_USERID=T1.USERID\n" + "\t IBZUSER_ROLE t LEFT JOIN IBZUSER t1 ON t.SYS_USERID=T1.USERID\n" +
"\t WHERE\n" + "\t WHERE\n" +
"\t T1.USERID = '%s'\n" + "\t T1.USERID = #{et.param0}\n" +
"\t)\n" + "\t)\n" +
"AND T1.PERMISSIONTYPE = '%s' "; "AND T1.PERMISSIONTYPE = #{et.param1} ";
Map opprivParam=new HashMap();
opprivParam.put("param0",user.getUserid());
opprivParam.put("param1",OPPriTag);
List<JSONObject> entitiesList= permissionService.select(opprivSQL,opprivParam); //查询用户权限下的菜单数据
Map uniresParam=new HashMap();
uniresParam.put("param0",user.getUserid());
uniresParam.put("param1",UniResTag);
List<JSONObject> entitiesList= permissionService.select(String.format(opprivSQL,user.getUserid(),OPPriTag)); //查询用户权限下的菜单数据 List<JSONObject> uniResList= permissionService.select(uniResSQL,uniresParam); //查询用户权限下的菜单数据
List<JSONObject> uniResList= permissionService.select(String.format(uniResSQL,user.getUserid(),UniResTag)); //查询用户权限下的菜单数据
JSONObject entities=getEntitiesList(entitiesList); JSONObject entities=getEntitiesList(entitiesList);
JSONArray uniRes=getUniRes(uniResList); JSONArray uniRes=getUniRes(uniResList);
permissionObj.put("entities",entities); permissionObj.put("entities",entities);
......
...@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -59,9 +60,13 @@ public class PermissionFeignService { ...@@ -59,9 +60,13 @@ public class PermissionFeignService {
*/ */
@PostMapping("/uaa/permission/save") @PostMapping("/uaa/permission/save")
public Map<String, JsonNode> pushSystemPermissionData(@RequestBody Map<String,Object> map, @Validated @NotBlank(message = "systemid不允许为空")@RequestParam("systemid")String systemId){ public Map<String, JsonNode> pushSystemPermissionData(@RequestBody Map<String,Object> map, @Validated @NotBlank(message = "systemid不允许为空")@RequestParam("systemid")String systemId){
//如果map值不为null说明要更新数据,则先将表中该系统标识下的所有数据进行逻辑删除 //如果map值不为null说明要更新数据,则先将表中该系统标识下的所有数据进行逻辑删除
Map param=new HashMap();
param.put("param0",systemId);
String sql="UPDATE ibzpermission t SET t.enable=0 WHERE SYSTEMID=#{et.param0} ";
if(map!=null){ if(map!=null){
permissionService.execute(String.format("UPDATE ibzpermission t SET t.enable=0 WHERE SYSTEMID='%s'",systemId)); permissionService.execute(sql,param);
} }
List<SYS_PSDEOPPRIV> opprivList=new ArrayList<>();//数据能力 List<SYS_PSDEOPPRIV> opprivList=new ArrayList<>();//数据能力
List<SYS_PERMISSION> permission_list=new ArrayList<>();//权限 List<SYS_PERMISSION> permission_list=new ArrayList<>();//权限
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册