Browse Source

分布式本地缓存

master
陈裕财 3 years ago
parent
commit
898d991db5
  1. 61
      xm-core/src/main/java/com/xm/core/ctrl/XmMenuController.java
  2. 34
      xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseController.java
  3. 31
      xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanCaseController.java

61
xm-core/src/main/java/com/xm/core/ctrl/XmMenuController.java

@ -109,21 +109,7 @@ public class XmMenuController {
RequestUtils.transformArray(xmMenu, "tagIdList");
RequestUtils.transformArray(xmMenu, "dclasss");
PageUtils.startPage(xmMenu);
String menuId= (String) xmMenu.get("menuId");
Object menuIds= xmMenu.get("menuIds");
String projectId= (String) xmMenu.get("projectId");
String mmUserid= (String) xmMenu.get("mmUserid");
String pmenuId= (String) xmMenu.get("pmenuId");
String productId= (String) xmMenu.get("productId");
String excludeIterationId= (String) xmMenu.get("excludeIterationId");
User user = LoginUtils.getCurrentUserInfo();
xmMenu.put("userid",user.getUserid());
if( !StringUtils.hasText(menuId) && !(StringUtils.hasText(projectId) || StringUtils.hasText(mmUserid)|| StringUtils.hasText(pmenuId)||menuIds!=null
|| StringUtils.hasText(productId) || StringUtils.hasText(excludeIterationId) ) ){
xmMenu.put("compete",user.getUserid());
}
this.paramsInit(xmMenu);
List<Map<String,Object>> xmMenuList = xmMenuService.selectListMapByWhere(xmMenu); //列出XmMenu列表
PageUtils.responePage(m, xmMenuList);
if("1".equals(xmMenu.get("withParents")) && !"1".equals(xmMenu.get("isTop"))&& xmMenuList.size()>0){
@ -153,30 +139,35 @@ public class XmMenuController {
return m;
}
public void paramsInit(Map<String,Object> xmMenu){
@RequestMapping(value="/listWithState",method=RequestMethod.GET)
public Map<String,Object> listWithState( @ApiIgnore @RequestParam Map<String,Object> xmMenu){
Map<String,Object> m = new HashMap<>();
RequestUtils.transformArray(xmMenu, "menuIds");
RequestUtils.transformArray(xmMenu, "tagIdList");
RequestUtils.transformArray(xmMenu, "dclasss");
PageUtils.startPage(xmMenu);
Tips tips=new Tips("查询成功");
String menuId= (String) xmMenu.get("menuId");
Object menuIds= xmMenu.get("menuIds");
String projectId= (String) xmMenu.get("projectId");
String linkProjectId= (String) xmMenu.get("linkProjectId");
String proposerId= (String) xmMenu.get("proposerId");
String mmUserid= (String) xmMenu.get("mmUserid");
String pmenuId= (String) xmMenu.get("pmenuId");
String productId= (String) xmMenu.get("productId");
String excludeIterationId= (String) xmMenu.get("excludeIterationId");
String iterationId = (String) xmMenu.get("iterationId");
String funcId = (String) xmMenu.get("funcId");
User user = LoginUtils.getCurrentUserInfo();
xmMenu.put("userid",user.getUserid());
if( !StringUtils.hasText(menuId) && !(StringUtils.hasText(projectId) || StringUtils.hasText(mmUserid)|| StringUtils.hasText(pmenuId)||menuIds!=null
|| StringUtils.hasText(productId) || StringUtils.hasText(excludeIterationId) ) ){
xmMenu.put("compete",user.getUserid());
if( !StringUtils.hasText(menuId) && !(StringUtils.hasText(linkProjectId) || StringUtils.hasText(mmUserid)|| StringUtils.hasText(pmenuId)||menuIds!=null
|| StringUtils.hasText(productId) || StringUtils.hasText(excludeIterationId)|| StringUtils.hasText(proposerId) || StringUtils.hasText(iterationId) || StringUtils.hasText(funcId) ) ){
User user = LoginUtils.getCurrentUserInfo();
xmMenu.put("pbranchId",user.getBranchId());
}
}
@RequestMapping(value="/listWithState",method=RequestMethod.GET)
public Map<String,Object> listWithState( @ApiIgnore @RequestParam Map<String,Object> xmMenu){
Map<String,Object> m = new HashMap<>();
RequestUtils.transformArray(xmMenu, "menuIds");
RequestUtils.transformArray(xmMenu, "tagIdList");
RequestUtils.transformArray(xmMenu, "dclasss");
PageUtils.startPage(xmMenu);
Tips tips=new Tips("查询成功");
this.paramsInit(xmMenu);
List<Map<String,Object>> xmMenuList = xmMenuService.selectListMapByWhereWithState(xmMenu); //列出XmMenu列表
PageUtils.responePage(m, xmMenuList);
if("1".equals(xmMenu.get("withParents")) && !"1".equals(xmMenu.get("isTop"))&& xmMenuList.size()>0){
@ -212,25 +203,23 @@ public class XmMenuController {
@RequestMapping(value="/getXmMenuAttDist",method=RequestMethod.GET)
public Map<String,Object> getXmMenuAttDist( @ApiIgnore @RequestParam Map<String,Object> xmMenu){
User user=LoginUtils.getCurrentUserInfo();
xmMenu.put("pbranchId",user.getBranchId());
this.paramsInit(xmMenu);
List<Map<String,Object>> datas= this.xmMenuService.getXmMenuAttDist(xmMenu);
return ResponseHelper.ok("ok","成功",datas);
}
@RequestMapping(value="/getXmMenuAgeDist",method=RequestMethod.GET)
public Map<String,Object> getXmMenuAgeDist( @ApiIgnore @RequestParam Map<String,Object> xmMenu){
User user=LoginUtils.getCurrentUserInfo();
xmMenu.put("pbranchId",user.getBranchId());
this.paramsInit(xmMenu);
List<Map<String,Object>> datas= this.xmMenuService.getXmMenuAgeDist(xmMenu);
return ResponseHelper.ok("ok","成功",datas);
}
@RequestMapping(value="/getXmMenuSort",method=RequestMethod.GET)
public Map<String,Object> getXmMenuSort( @ApiIgnore @RequestParam Map<String,Object> xmMenu){
User user=LoginUtils.getCurrentUserInfo();
PageUtils.startPage(xmMenu);
xmMenu.put("pbranchId",user.getBranchId());
this.paramsInit(xmMenu);
List<Map<String,Object>> datas= this.xmMenuService.getXmMenuSort(xmMenu);
Map<String,Object> m=new HashMap<>();
PageUtils.responePage(m,datas);

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

@ -75,18 +75,7 @@ public class XmTestCaseController {
RequestUtils.transformArray(xmTestCase, "ids");
RequestUtils.transformArray(xmTestCase, "menuIds");
PageUtils.startPage(xmTestCase);
String id= (String) xmTestCase.get("id");
String menuId= (String) xmTestCase.get("menuId");
Object ids= xmTestCase.get("ids");
Object menuIds= xmTestCase.get("menuIds");
String productId= (String) xmTestCase.get("productId");
String myUserid= (String) xmTestCase.get("myUserid");
String projectId= (String) xmTestCase.get("projectId");
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());
}
paramsInit(xmTestCase);
List<Map<String,Object>> xmTestCaseList = xmTestCaseService.selectListMapByWhere(xmTestCase); //列出XmTestCase列表
PageUtils.responePage(m, xmTestCaseList);
m.put("data",xmTestCaseList);
@ -95,7 +84,26 @@ public class XmTestCaseController {
return m;
}
public void paramsInit(Map<String,Object> xmTestCase){
Object ids=xmTestCase.get("ids");
Object menuIds=xmTestCase.get("menuIds");
Object caseIds=xmTestCase.get("caseIds");
String id= (String) xmTestCase.get("id");
String cuserid = (String) xmTestCase.get("cuserid");
String menuId= (String) xmTestCase.get("menuId");
String funcId= (String) xmTestCase.get("funcId");
String iteration= (String) xmTestCase.get("iteration");
String casedbId= (String) xmTestCase.get("casedbId");
String productId= (String) xmTestCase.get("productId");
String projectId= (String) xmTestCase.get("projectId");
String planId= (String) xmTestCase.get("planId");
String caseId= (String) xmTestCase.get("caseId");
if(!(StringUtils.hasText(id)||StringUtils.hasText(menuId)||StringUtils.hasText(funcId)||StringUtils.hasText(iteration)||StringUtils.hasText(casedbId)||StringUtils.hasText(productId)||StringUtils.hasText(projectId)
||StringUtils.hasText(planId)||StringUtils.hasText(caseId)||StringUtils.hasText(cuserid)||ids!=null||caseIds!=null||menuIds!=null)){
User user=LoginUtils.getCurrentUserInfo();
xmTestCase.put("pbranchId",user.getBranchId());
}
}
@ApiOperation( value = "新增一条测试用例信息",notes=" ")
@ApiResponses({

31
xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanCaseController.java

@ -76,8 +76,9 @@ public class XmTestPlanCaseController {
Tips tips=new Tips("查询成功");
RequestUtils.transformArray(xmTestPlanCase, "pkList");
PageUtils.startPage(xmTestPlanCase);
User user= LoginUtils.getCurrentUserInfo();
xmTestPlanCase.put("pbranchId",user.getBranchId());
paramsInit(xmTestPlanCase);
List<Map<String,Object>> xmTestPlanCaseList = xmTestPlanCaseService.selectListMapByWhere(xmTestPlanCase); //列出XmTestPlanCase列表
PageUtils.responePage(m, xmTestPlanCaseList);
m.put("data",xmTestPlanCaseList);
@ -86,7 +87,24 @@ public class XmTestPlanCaseController {
return m;
}
public void paramsInit(Map<String,Object> xmTestPlanCase){
Object pkList=xmTestPlanCase.get("pkList");
Object caseIds=xmTestPlanCase.get("caseIds");
String menuId= (String) xmTestPlanCase.get("menuId");
String funcId= (String) xmTestPlanCase.get("funcId");
String linkIteration= (String) xmTestPlanCase.get("linkIteration");
String casedbId= (String) xmTestPlanCase.get("casedbId");
String productId= (String) xmTestPlanCase.get("productId");
String projectId= (String) xmTestPlanCase.get("projectId");
String planId= (String) xmTestPlanCase.get("planId");
String caseId= (String) xmTestPlanCase.get("caseId");
String execUserid= (String) xmTestPlanCase.get("execUserid");
if(!(StringUtils.hasText(menuId)||StringUtils.hasText(funcId)||StringUtils.hasText(linkIteration)||StringUtils.hasText(casedbId)||StringUtils.hasText(productId)||StringUtils.hasText(projectId)
||StringUtils.hasText(planId)||StringUtils.hasText(caseId)||StringUtils.hasText(execUserid)||pkList!=null||caseIds!=null)){
User user=LoginUtils.getCurrentUserInfo();
xmTestPlanCase.put("pbranchId",user.getBranchId());
}
}
@ApiOperation( value = "查询执行结果分布",notes=" ")
@ -99,7 +117,7 @@ public class XmTestPlanCaseController {
Tips tips=new Tips("查询成功");
PageUtils.startPage(xmTestPlanCase);
User user= LoginUtils.getCurrentUserInfo();
xmTestPlanCase.put("pbranchId",user.getBranchId());
paramsInit(xmTestPlanCase);
List<Map<String,Object>> xmTestPlanCaseList = xmTestPlanCaseService.getXmTestPlanCaseExecStatusDist(xmTestPlanCase); //列出XmTestPlanCase列表
PageUtils.responePage(m, xmTestPlanCaseList);
m.put("data",xmTestPlanCaseList);
@ -118,8 +136,7 @@ public class XmTestPlanCaseController {
Map<String,Object> m = new HashMap<>();
Tips tips=new Tips("查询成功");
PageUtils.startPage(xmTestPlanCase);
User user= LoginUtils.getCurrentUserInfo();
xmTestPlanCase.put("pbranchId",user.getBranchId());
paramsInit(xmTestPlanCase);
List<Map<String,Object>> xmTestPlanCaseList = xmTestPlanCaseService.getXmTestPlanCaseUserDist(xmTestPlanCase); //列出XmTestPlanCase列表
PageUtils.responePage(m, xmTestPlanCaseList);
m.put("data",xmTestPlanCaseList);
@ -139,7 +156,7 @@ public class XmTestPlanCaseController {
Tips tips=new Tips("查询成功");
PageUtils.startPage(xmTestPlanCase);
User user= LoginUtils.getCurrentUserInfo();
xmTestPlanCase.put("pbranchId",user.getBranchId());
paramsInit(xmTestPlanCase);
List<Map<String,Object>> xmTestPlanCaseList = xmTestPlanCaseService.getXmTestDayTimesList(xmTestPlanCase); //列出XmTestPlanCase列表
PageUtils.responePage(m, xmTestPlanCaseList);
m.put("data",xmTestPlanCaseList);
@ -157,7 +174,7 @@ public class XmTestPlanCaseController {
Tips tips=new Tips("查询成功");
PageUtils.startPage(xmTestPlanCase);
User user= LoginUtils.getCurrentUserInfo();
xmTestPlanCase.put("pbranchId",user.getBranchId());
paramsInit(xmTestPlanCase);
List<Map<String,Object>> xmTestPlanCaseList = xmTestPlanCaseService.getXmTestCaseToPlanCalcList(xmTestPlanCase); //列出XmTestPlanCase列表
PageUtils.responePage(m, xmTestPlanCaseList);
m.put("data",xmTestPlanCaseList);

Loading…
Cancel
Save