Browse Source

分布式本地缓存

master
陈裕财 3 years ago
parent
commit
6b4d05fe9e
  1. 16
      xm-core/src/main/java/com/xm/core/ctrl/XmQuestionController.java
  2. 4
      xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseController.java
  3. 5
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmQuestionMapper.xml

16
xm-core/src/main/java/com/xm/core/ctrl/XmQuestionController.java

@ -106,8 +106,24 @@ public class XmQuestionController {
if(LoginUtils.isBranchAdmin()){ if(LoginUtils.isBranchAdmin()){
xmQuestion.put("pbranchId",user.getBranchId()); xmQuestion.put("pbranchId",user.getBranchId());
}else { }else {
String id= (String) xmQuestion.get("id");
String menuId= (String) xmQuestion.get("menuId");
Object ids= xmQuestion.get("ids");
Object menuIds= xmQuestion.get("menuIds");
String productId= (String) xmQuestion.get("productId");
String myUserid= (String) xmQuestion.get("myUserid");
String projectId= (String) xmQuestion.get("projectId");
String linkIterationId= (String) xmQuestion.get("linkIterationId");
String casedbId= (String) xmQuestion.get("casedbId");
String planId= (String) xmQuestion.get("planId");
String funcId= (String) xmQuestion.get("funcId");
String hisHandlerUserid= (String) xmQuestion.get("hisHandlerUserid");
if( !( StringUtils.hasText(myUserid) ||StringUtils.hasText(id) || StringUtils.hasText(menuId) || StringUtils.hasText(productId)|| StringUtils.hasText(projectId)||menuIds!=null||ids!=null|| StringUtils.hasText(casedbId)|| StringUtils.hasText(linkIterationId)|| StringUtils.hasText(planId)|| StringUtils.hasText(funcId) || StringUtils.hasText(hisHandlerUserid)) ){
xmQuestion.put("compete",user.getUserid()); xmQuestion.put("compete",user.getUserid());
} }
}
List<Map<String,Object>> xmQuestionList = xmQuestionService.getQuestion(xmQuestion); //列出XmQuestion列表 List<Map<String,Object>> xmQuestionList = xmQuestionService.getQuestion(xmQuestion); //列出XmQuestion列表

4
xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseController.java

@ -82,7 +82,9 @@ public class XmTestCaseController {
String productId= (String) xmTestCase.get("productId"); String productId= (String) xmTestCase.get("productId");
String myUserid= (String) xmTestCase.get("myUserid"); String myUserid= (String) xmTestCase.get("myUserid");
String projectId= (String) xmTestCase.get("projectId"); String projectId= (String) xmTestCase.get("projectId");
if( !( StringUtils.hasText(myUserid) ||StringUtils.hasText(id) || StringUtils.hasText(menuId) || StringUtils.hasText(productId)|| StringUtils.hasText(projectId)||menuIds!=null||ids!=null ) ){
String iterationId= (String) xmTestCase.get("iterationId");
String casedbId= (String) xmTestCase.get("casedbId");
if( !( StringUtils.hasText(myUserid) ||StringUtils.hasText(id) || StringUtils.hasText(menuId) || StringUtils.hasText(productId)|| StringUtils.hasText(projectId)||menuIds!=null||ids!=null|| StringUtils.hasText(casedbId)|| StringUtils.hasText(iterationId) ) ){
xmTestCase.put("compete", LoginUtils.getCurrentUserInfo().getUserid()); xmTestCase.put("compete", LoginUtils.getCurrentUserInfo().getUserid());
} }
List<Map<String,Object>> xmTestCaseList = xmTestCaseService.selectListMapByWhere(xmTestCase); //列出XmTestCase列表 List<Map<String,Object>> xmTestCaseList = xmTestCaseService.selectListMapByWhere(xmTestCase); //列出XmTestCase列表

5
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmQuestionMapper.xml

@ -30,10 +30,7 @@
and (res.handler_userid=#{compete} or res.create_userid=#{compete} or exists ( select 1 from xm_group_user gu where gu.userid=#{compete} and (gu.project_id=res.project_id or gu.product_id=res.product_id))) and (res.handler_userid=#{compete} or res.create_userid=#{compete} or exists ( select 1 from xm_group_user gu where gu.userid=#{compete} and (gu.project_id=res.project_id or gu.product_id=res.product_id)))
</if> </if>
<if test="key != null and key !='' "> and res.name like #{key} </if> <if test="key != null and key !='' "> and res.name like #{key} </if>
<if test="work != null and work != ''"> and res.status in ('1','2','3','4','7') </if>
<if test="branchId!=null and branchId!=''">
and exists( select 1 from xm_project p where p.id=res.project_id and p.branch_id=#{branchId})
</if>
<if test="work != null and work != ''"> and res.status !='8' </if>
<if test="linkIterationId != null and linkIterationId != ''"> and exists (select 1 from xm_menu m where m.iteration_id=#{linkIterationId} and m.menu_id=res.menu_id) </if> <if test="linkIterationId != null and linkIterationId != ''"> and exists (select 1 from xm_menu m where m.iteration_id=#{linkIterationId} and m.menu_id=res.menu_id) </if>
</sql> </sql>

Loading…
Cancel
Save