From 18dcdaef94ca4534bbc5691ff452f7b1dce58901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Mon, 18 Jul 2022 21:37:01 +0800 Subject: [PATCH] bug --- .../xm/core/ctrl/XmTestCaseController.java | 52 +-- .../core/ctrl/XmTestCaseExecController.java | 283 --------------- .../xm/core/ctrl/XmTestCasedbController.java | 51 +-- .../core/ctrl/XmTestPlanCaseController.java | 49 +-- .../xm/core/ctrl/XmTestPlanController.java | 51 +-- .../com/xm/core/entity/XmTestCaseExec.java | 334 ------------------ .../core/service/XmTestCaseExecService.java | 29 -- .../xm/core/dao/XmTestCaseExecMapper.xml | 241 ------------- 8 files changed, 75 insertions(+), 1015 deletions(-) delete mode 100644 xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseExecController.java delete mode 100644 xm-core/src/main/java/com/xm/core/entity/XmTestCaseExec.java delete mode 100644 xm-core/src/main/java/com/xm/core/service/XmTestCaseExecService.java delete mode 100644 xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseExecMapper.xml diff --git a/xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseController.java b/xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseController.java index 77db5bb4..95a91eb8 100644 --- a/xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseController.java +++ b/xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseController.java @@ -1,32 +1,28 @@ package com.xm.core.ctrl; -import java.util.*; -import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.*; - -import static com.mdp.core.utils.ResponseHelper.*; -import static com.mdp.core.utils.BaseUtils.*; import com.mdp.core.entity.Tips; import com.mdp.core.err.BizException; -import com.mdp.mybatis.PageUtils; import com.mdp.core.utils.RequestUtils; -import com.mdp.core.utils.NumberUtil; +import com.mdp.mybatis.PageUtils; import com.mdp.safe.client.entity.User; import com.mdp.safe.client.utils.LoginUtils; import com.mdp.swagger.ApiEntityParams; +import com.xm.core.entity.XmTestCase; +import com.xm.core.service.XmTestCaseService; +import io.swagger.annotations.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; -import com.xm.core.service.XmTestCaseService; -import com.xm.core.entity.XmTestCase; +import java.util.*; +import java.util.stream.Collectors; + +import static com.mdp.core.utils.BaseUtils.fromMap; +import static com.mdp.core.utils.BaseUtils.toMap; +import static com.mdp.core.utils.ResponseHelper.failed; /** * url编制采用rest风格,如对xm_test_case 测试用例的操作有增删改查,对应的url分别为:
@@ -85,8 +81,7 @@ public class XmTestCaseController { } - - /** + @ApiOperation( value = "新增一条测试用例信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200,response=XmTestCase.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") @@ -118,9 +113,7 @@ public class XmTestCaseController { m.put("tips", tips); return m; } - */ - - /** + @ApiOperation( value = "删除一条测试用例信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}") @@ -148,9 +141,7 @@ public class XmTestCaseController { m.put("tips", tips); return m; } - */ - - /** + @ApiOperation( value = "根据主键修改一条测试用例信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200,response=XmTestCase.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") @@ -179,9 +170,7 @@ public class XmTestCaseController { m.put("tips", tips); return m; } - */ - /** @ApiOperation( value = "批量修改某些字段",notes="") @ApiEntityParams( value = XmTestCase.class, props={ }, remark = "测试用例", paramType = "body" ) @ApiResponses({ @@ -253,9 +242,7 @@ public class XmTestCaseController { m.put("tips", tips); return m; } - */ - /** @ApiOperation( value = "根据主键列表批量删除测试用例信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") @@ -302,6 +289,5 @@ public class XmTestCaseController { } m.put("tips", tips); return m; - } - */ + } } diff --git a/xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseExecController.java b/xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseExecController.java deleted file mode 100644 index 281bdbfb..00000000 --- a/xm-core/src/main/java/com/xm/core/ctrl/XmTestCaseExecController.java +++ /dev/null @@ -1,283 +0,0 @@ -package com.xm.core.ctrl; - -import com.mdp.core.entity.Tips; -import com.mdp.core.err.BizException; -import com.mdp.core.utils.RequestUtils; -import com.mdp.mybatis.PageUtils; -import com.mdp.qx.HasQx; -import com.mdp.safe.client.utils.LoginUtils; -import com.xm.core.entity.XmTestCaseExec; -import com.xm.core.service.XmTestCaseExecService; -import io.swagger.annotations.*; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * url编制采用rest风格,如对XM.xm_test_case_exec xm_test_case_exec的操作有增删改查,对应的url分别为:
- * 新增: core/xmTestCaseExec/add
- * 查询: core/xmTestCaseExec/list
- * 模糊查询: core/xmTestCaseExec/listKey
- * 修改: core/xmTestCaseExec/edit
- * 删除: core/xmTestCaseExec/del
- * 批量删除: core/xmTestCaseExec/batchDel
- * 组织 com.qqkj 顶级模块 xm 大模块 core 小模块
- * 实体 XmTestCaseExec 表 XM.xm_test_case_exec 当前主键(包括多主键): id; - ***/ -@RestController("xm.core.xmTestCaseExecController") -@RequestMapping(value="/**/core/xmTestCaseExec") -@Api(tags={"xm_test_case_exec操作接口"}) -public class XmTestCaseExecController { - - static Log logger=LogFactory.getLog(XmTestCaseExecController.class); - - @Autowired - private XmTestCaseExecService xmTestCaseExecService; - - - - - @ApiOperation( value = "查询xm_test_case_exec信息列表",notes="listXmTestCaseExec,条件之间是 and关系,模糊查询写法如 {studentName:'%才哥%'}") - @ApiImplicitParams({ - @ApiImplicitParam(name="id",value="执行编号,主键",required=false), - @ApiImplicitParam(name="execUserid",value="执行人",required=false), - @ApiImplicitParam(name="startTime",value="开始时间",required=false), - @ApiImplicitParam(name="projectId",value="项目编号",required=false), - @ApiImplicitParam(name="projectName",value="项目名称",required=false), - @ApiImplicitParam(name="caseId",value="测试案例编号",required=false), - @ApiImplicitParam(name="caseName",value="测试案例名称",required=false), - @ApiImplicitParam(name="endTime",value="到期时间",required=false), - @ApiImplicitParam(name="remark",value="问题描述",required=false), - @ApiImplicitParam(name="createUserid",value="问题创建人编号",required=false), - @ApiImplicitParam(name="createUsername",value="问题创建人",required=false), - @ApiImplicitParam(name="createTime",value="创建时间",required=false), - @ApiImplicitParam(name="execStatus",value="0新建1测试中2已完成",required=false), - @ApiImplicitParam(name="iterationId",value="迭代编号",required=false), - @ApiImplicitParam(name="iterationName",value="迭代名称",required=false), - @ApiImplicitParam(name="execUsername",value="执行人姓名",required=false), - @ApiImplicitParam(name="taskId",value="归属测试任务编号",required=false), - @ApiImplicitParam(name="taskName",value="归属测试任务名称",required=false), - @ApiImplicitParam(name="menuId",value="需求编号",required=false), - @ApiImplicitParam(name="pageSize",value="每页记录数",required=false), - @ApiImplicitParam(name="pageNum",value="当前页码,从1开始",required=false), - @ApiImplicitParam(name="total",value="总记录数,服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算",required=false), - @ApiImplicitParam(name="orderBy",value="排序列 如性别、学生编号排序 orderBy = sex desc,student_id desc",required=false), - @ApiImplicitParam(name="count",value="是否进行总条数计算,count=true|false",required=false) - }) - @ApiResponses({ - @ApiResponse(code = 200,response= XmTestCaseExec.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}") - }) - @RequestMapping(value="/list",method=RequestMethod.GET) - public Map listXmTestCaseExec( @ApiIgnore @RequestParam Map xmTestCaseExec){ - Map m = new HashMap<>(); - RequestUtils.transformArray(xmTestCaseExec, "ids"); - RequestUtils.transformArray(xmTestCaseExec, "menuIds"); - PageUtils.startPage(xmTestCaseExec); - Tips tips=new Tips("查询成功"); - String id= (String) xmTestCaseExec.get("id"); - String menuId= (String) xmTestCaseExec.get("menuId"); - Object ids= xmTestCaseExec.get("ids"); - Object menuIds= xmTestCaseExec.get("menuIds"); - String projectId= (String) xmTestCaseExec.get("projectId"); - String productId= (String) xmTestCaseExec.get("productId"); - String caseId= (String) xmTestCaseExec.get("caseId"); - if( !( StringUtils.hasText(caseId)||StringUtils.hasText(id) || StringUtils.hasText(menuId) || StringUtils.hasText(projectId)|| StringUtils.hasText(productId)||menuIds!=null||ids!=null ) ){ - xmTestCaseExec.put("compete", LoginUtils.getCurrentUserInfo().getUserid()); - } - List> xmTestCaseExecList = xmTestCaseExecService.selectListMapByWhere(xmTestCaseExec); //列出XmTestCaseExec列表 - PageUtils.responePage(m, xmTestCaseExecList); - m.put("data",xmTestCaseExecList); - - m.put("tips", tips); - return m; - } - - - - /***/ - @ApiOperation( value = "新增一条xm_test_case_exec信息",notes="addXmTestCaseExec,主键如果为空,后台自动生成") - @ApiResponses({ - @ApiResponse(code = 200,response=XmTestCaseExec.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") - }) - @HasQx(value = "xm_core_xmTestCaseExec_add",name = "新增测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") - @RequestMapping(value="/add",method=RequestMethod.POST) - public Map addXmTestCaseExec(@RequestBody XmTestCaseExec xmTestCaseExec) { - Map m = new HashMap<>(); - Tips tips=new Tips("成功新增一条数据"); - try{ - if(StringUtils.isEmpty(xmTestCaseExec.getId())) { - xmTestCaseExec.setId(xmTestCaseExecService.createKey("id")); - }else{ - XmTestCaseExec xmTestCaseExecQuery = new XmTestCaseExec(xmTestCaseExec.getId()); - if(xmTestCaseExecService.countByWhere(xmTestCaseExecQuery)>0){ - tips.setFailureMsg("编号重复,请修改编号再提交"); - m.put("tips", tips); - return m; - } - } - xmTestCaseExecService.insert(xmTestCaseExec); - m.put("data",xmTestCaseExec); - }catch (BizException e) { - tips=e.getTips(); - logger.error("",e); - }catch (Exception e) { - tips.setFailureMsg(e.getMessage()); - logger.error("",e); - } - m.put("tips", tips); - return m; - } - - - /** */ - @ApiOperation( value = "删除一条xm_test_case_exec信息",notes="delXmTestCaseExec,仅需要上传主键字段") - @ApiResponses({ - @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}") - }) - @HasQx(value = "xm_core_xmTestCaseExec_del",name = "删除测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") - @RequestMapping(value="/del",method=RequestMethod.POST) - public Map delXmTestCaseExec(@RequestBody XmTestCaseExec xmTestCaseExec){ - Map m = new HashMap<>(); - Tips tips=new Tips("成功删除一条数据"); - try{ - xmTestCaseExecService.deleteByPk(xmTestCaseExec); - }catch (BizException e) { - tips=e.getTips(); - logger.error("",e); - }catch (Exception e) { - tips.setFailureMsg(e.getMessage()); - logger.error("",e); - } - m.put("tips", tips); - return m; - } - - - /***/ - @ApiOperation( value = "根据主键修改一条xm_test_case_exec信息",notes="editXmTestCaseExec") - @ApiResponses({ - @ApiResponse(code = 200,response=XmTestCaseExec.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") - }) - @HasQx(value = "xm_core_xmTestCaseExec_edit",name = "修改测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") - @RequestMapping(value="/edit",method=RequestMethod.POST) - public Map editXmTestCaseExec(@RequestBody XmTestCaseExec xmTestCaseExec) { - Map m = new HashMap<>(); - Tips tips=new Tips("成功更新一条数据"); - try{ - xmTestCaseExecService.updateByPk(xmTestCaseExec); - m.put("data",xmTestCaseExec); - }catch (BizException e) { - tips=e.getTips(); - logger.error("",e); - }catch (Exception e) { - tips.setFailureMsg(e.getMessage()); - logger.error("",e); - } - m.put("tips", tips); - return m; - } - - - - - /***/ - @ApiOperation( value = "根据主键列表批量删除xm_test_case_exec信息",notes="batchDelXmTestCaseExec,仅需要上传主键字段") - @ApiResponses({ - @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") - }) - @HasQx(value = "xm_core_xmTestCaseExec_batchDel",name = "批量删除测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") - @RequestMapping(value="/batchDel",method=RequestMethod.POST) - public Map batchDelXmTestCaseExec(@RequestBody List xmTestCaseExecs) { - Map m = new HashMap<>(); - Tips tips=new Tips("成功删除"+xmTestCaseExecs.size()+"条数据"); - try{ - xmTestCaseExecService.batchDelete(xmTestCaseExecs); - }catch (BizException e) { - tips=e.getTips(); - logger.error("",e); - }catch (Exception e) { - tips.setFailureMsg(e.getMessage()); - logger.error("",e); - } - m.put("tips", tips); - return m; - } - @ApiOperation( value = "批量新增") - @ApiResponses({ - @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") - }) - @HasQx(value = "xm_core_xmTestCaseExec_batchAdd",name = "批量新增测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") - @RequestMapping(value="/batchAdd",method=RequestMethod.POST) - public Map batchAddXmTestCaseExec(@RequestBody List xmTestCaseExecs) { - Map m = new HashMap<>(); - Tips tips=new Tips("成功新增"+xmTestCaseExecs.size()+"条数据"); - try{ - /** - * 根据caseId,projectId判断是否重复,重复的应该忽略 - */ - List caseIds=new ArrayList<>(); - String projectId=""; - for (XmTestCaseExec ce : xmTestCaseExecs) { - caseIds.add(ce.getCaseId()); - projectId=ce.getProjectId(); - } - List existsList=this.xmTestCaseExecService.listByProjectAndCaseIds(projectId,caseIds); - List canAddList=new ArrayList<>(); - for (XmTestCaseExec xmTestCaseExec : xmTestCaseExecs) { - boolean exists=false; - for (XmTestCaseExec ce : existsList) { - if(xmTestCaseExec.getProjectId().equals(ce.getProjectId()) && xmTestCaseExec.getCaseId().equals(ce.getCaseId())) { - exists=true; - break; - } - - } - if(exists==false) { - canAddList.add(xmTestCaseExec); - } - } - if(canAddList.size()>0) { - xmTestCaseExecService.batchInsert(canAddList); - } - tips.setOkMsg("成功新增"+canAddList.size()+"条数据,忽略已存在的"+(xmTestCaseExecs.size()-canAddList.size())+"条数据"); - }catch (BizException e) { - tips=e.getTips(); - logger.error("",e); - }catch (Exception e) { - tips.setFailureMsg(e.getMessage()); - logger.error("",e); - } - m.put("tips", tips); - return m; - } - @ApiOperation( value = "批量修改") - @ApiResponses({ - @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") - }) - @HasQx(value = "xm_core_xmTestCaseExec_batchEdit",name = "批量修改测试计划",moduleId = "xm-project",moduleName = "管理端-项目管理系统") - @RequestMapping(value="/batchEdit",method=RequestMethod.POST) - public Map batchEditXmTestCaseExec(@RequestBody List xmTestCaseExecs) { - Map m = new HashMap<>(); - Tips tips=new Tips("成功修改"+xmTestCaseExecs.size()+"条数据"); - try{ - xmTestCaseExecService.batchUpdate(xmTestCaseExecs); - }catch (BizException e) { - tips=e.getTips(); - logger.error("",e); - }catch (Exception e) { - tips.setFailureMsg(e.getMessage()); - logger.error("",e); - } - m.put("tips", tips); - return m; - } - -} diff --git a/xm-core/src/main/java/com/xm/core/ctrl/XmTestCasedbController.java b/xm-core/src/main/java/com/xm/core/ctrl/XmTestCasedbController.java index 7c76f65e..d0a062fe 100644 --- a/xm-core/src/main/java/com/xm/core/ctrl/XmTestCasedbController.java +++ b/xm-core/src/main/java/com/xm/core/ctrl/XmTestCasedbController.java @@ -1,32 +1,28 @@ package com.xm.core.ctrl; -import java.util.*; -import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.*; - -import static com.mdp.core.utils.ResponseHelper.*; -import static com.mdp.core.utils.BaseUtils.*; import com.mdp.core.entity.Tips; import com.mdp.core.err.BizException; -import com.mdp.mybatis.PageUtils; import com.mdp.core.utils.RequestUtils; -import com.mdp.core.utils.NumberUtil; +import com.mdp.mybatis.PageUtils; import com.mdp.safe.client.entity.User; import com.mdp.safe.client.utils.LoginUtils; import com.mdp.swagger.ApiEntityParams; +import com.xm.core.entity.XmTestCasedb; +import com.xm.core.service.XmTestCasedbService; +import io.swagger.annotations.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; -import com.xm.core.service.XmTestCasedbService; -import com.xm.core.entity.XmTestCasedb; +import java.util.*; +import java.util.stream.Collectors; + +import static com.mdp.core.utils.BaseUtils.fromMap; +import static com.mdp.core.utils.BaseUtils.toMap; +import static com.mdp.core.utils.ResponseHelper.failed; /** * url编制采用rest风格,如对xm_test_casedb 测试用例库的操作有增删改查,对应的url分别为:
@@ -74,8 +70,7 @@ public class XmTestCasedbController { } - - /** + @ApiOperation( value = "新增一条测试用例库信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200,response=XmTestCasedb.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") @@ -107,9 +102,7 @@ public class XmTestCasedbController { m.put("tips", tips); return m; } - */ - - /** + @ApiOperation( value = "删除一条测试用例库信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}") @@ -137,9 +130,7 @@ public class XmTestCasedbController { m.put("tips", tips); return m; } - */ - - /** + @ApiOperation( value = "根据主键修改一条测试用例库信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200,response=XmTestCasedb.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") @@ -168,9 +159,7 @@ public class XmTestCasedbController { m.put("tips", tips); return m; } - */ - /** @ApiOperation( value = "批量修改某些字段",notes="") @ApiEntityParams( value = XmTestCasedb.class, props={ }, remark = "测试用例库", paramType = "body" ) @ApiResponses({ @@ -242,9 +231,7 @@ public class XmTestCasedbController { m.put("tips", tips); return m; } - */ - /** @ApiOperation( value = "根据主键列表批量删除测试用例库信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") @@ -292,5 +279,5 @@ public class XmTestCasedbController { m.put("tips", tips); return m; } - */ + } diff --git a/xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanCaseController.java b/xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanCaseController.java index b78e11f3..d2d31ffa 100644 --- a/xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanCaseController.java +++ b/xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanCaseController.java @@ -1,32 +1,27 @@ package com.xm.core.ctrl; -import java.util.*; -import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.*; - -import static com.mdp.core.utils.ResponseHelper.*; -import static com.mdp.core.utils.BaseUtils.*; import com.mdp.core.entity.Tips; import com.mdp.core.err.BizException; -import com.mdp.mybatis.PageUtils; import com.mdp.core.utils.RequestUtils; -import com.mdp.core.utils.NumberUtil; +import com.mdp.mybatis.PageUtils; import com.mdp.safe.client.entity.User; import com.mdp.safe.client.utils.LoginUtils; import com.mdp.swagger.ApiEntityParams; +import com.xm.core.entity.XmTestPlanCase; +import com.xm.core.service.XmTestPlanCaseService; +import io.swagger.annotations.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; -import com.xm.core.service.XmTestPlanCaseService; -import com.xm.core.entity.XmTestPlanCase; +import java.util.*; +import java.util.stream.Collectors; + +import static com.mdp.core.utils.BaseUtils.*; +import static com.mdp.core.utils.ResponseHelper.failed; /** * url编制采用rest风格,如对xm_test_plan_case 测试计划与用例关系表的操作有增删改查,对应的url分别为:
@@ -75,7 +70,7 @@ public class XmTestPlanCaseController { - /** + @ApiOperation( value = "新增一条测试计划与用例关系表信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200,response=XmTestPlanCase.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") @@ -111,9 +106,7 @@ public class XmTestPlanCaseController { m.put("tips", tips); return m; } - */ - - /** + @ApiOperation( value = "删除一条测试计划与用例关系表信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}") @@ -144,9 +137,7 @@ public class XmTestPlanCaseController { m.put("tips", tips); return m; } - */ - - /** + @ApiOperation( value = "根据主键修改一条测试计划与用例关系表信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200,response=XmTestPlanCase.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") @@ -178,9 +169,7 @@ public class XmTestPlanCaseController { m.put("tips", tips); return m; } - */ - /** @ApiOperation( value = "批量修改某些字段",notes="") @ApiEntityParams( value = XmTestPlanCase.class, props={ }, remark = "测试计划与用例关系表", paramType = "body" ) @ApiResponses({ @@ -253,9 +242,7 @@ public class XmTestPlanCaseController { m.put("tips", tips); return m; } - */ - /** @ApiOperation( value = "根据主键列表批量删除测试计划与用例关系表信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") @@ -303,5 +290,5 @@ public class XmTestPlanCaseController { m.put("tips", tips); return m; } - */ + } diff --git a/xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanController.java b/xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanController.java index f791d29e..db9c200a 100644 --- a/xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanController.java +++ b/xm-core/src/main/java/com/xm/core/ctrl/XmTestPlanController.java @@ -1,32 +1,28 @@ package com.xm.core.ctrl; -import java.util.*; -import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import io.swagger.annotations.*; - -import static com.mdp.core.utils.ResponseHelper.*; -import static com.mdp.core.utils.BaseUtils.*; import com.mdp.core.entity.Tips; import com.mdp.core.err.BizException; -import com.mdp.mybatis.PageUtils; import com.mdp.core.utils.RequestUtils; -import com.mdp.core.utils.NumberUtil; +import com.mdp.mybatis.PageUtils; import com.mdp.safe.client.entity.User; import com.mdp.safe.client.utils.LoginUtils; import com.mdp.swagger.ApiEntityParams; +import com.xm.core.entity.XmTestPlan; +import com.xm.core.service.XmTestPlanService; +import io.swagger.annotations.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; -import com.xm.core.service.XmTestPlanService; -import com.xm.core.entity.XmTestPlan; +import java.util.*; +import java.util.stream.Collectors; + +import static com.mdp.core.utils.BaseUtils.fromMap; +import static com.mdp.core.utils.BaseUtils.toMap; +import static com.mdp.core.utils.ResponseHelper.failed; /** * url编制采用rest风格,如对xm_test_plan 测试计划的操作有增删改查,对应的url分别为:
@@ -74,8 +70,7 @@ public class XmTestPlanController { } - - /** + @ApiOperation( value = "新增一条测试计划信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200,response=XmTestPlan.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") @@ -107,9 +102,7 @@ public class XmTestPlanController { m.put("tips", tips); return m; } - */ - - /** + @ApiOperation( value = "删除一条测试计划信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}") @@ -137,9 +130,7 @@ public class XmTestPlanController { m.put("tips", tips); return m; } - */ - - /** + @ApiOperation( value = "根据主键修改一条测试计划信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200,response=XmTestPlan.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") @@ -168,9 +159,7 @@ public class XmTestPlanController { m.put("tips", tips); return m; } - */ - /** @ApiOperation( value = "批量修改某些字段",notes="") @ApiEntityParams( value = XmTestPlan.class, props={ }, remark = "测试计划", paramType = "body" ) @ApiResponses({ @@ -242,9 +231,7 @@ public class XmTestPlanController { m.put("tips", tips); return m; } - */ - /** @ApiOperation( value = "根据主键列表批量删除测试计划信息",notes=" ") @ApiResponses({ @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") @@ -292,5 +279,5 @@ public class XmTestPlanController { m.put("tips", tips); return m; } - */ + } diff --git a/xm-core/src/main/java/com/xm/core/entity/XmTestCaseExec.java b/xm-core/src/main/java/com/xm/core/entity/XmTestCaseExec.java deleted file mode 100644 index 3f8f9971..00000000 --- a/xm-core/src/main/java/com/xm/core/entity/XmTestCaseExec.java +++ /dev/null @@ -1,334 +0,0 @@ -package com.xm.core.entity; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import java.util.Date; - -/** - * 组织 com.qqkj 顶级模块 xm 大模块 core 小模块
- * 实体 XmTestCaseExec所有属性名:
- * execUserid,startTime,id,projectId,projectName,caseId,caseName,endTime,remark,createUserid,createUsername,createTime,execStatus,iterationId,iterationName,execUsername,taskId,taskName,menuId,menuName;
- * 表 XM.xm_test_case_exec xm_test_case_exec的所有字段名:
- * exec_userid,start_time,id,project_id,project_name,case_id,case_name,end_time,remark,create_userid,create_username,create_time,exec_status,iteration_id,iteration_name,exec_username,task_id,task_name,menu_id,menu_name;
- * 当前主键(包括多主键):
- * id;
- */ -@ApiModel(description="xm_test_case_exec") -public class XmTestCaseExec implements java.io.Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(notes="执行编号,主键",allowEmptyValue=true,example="",allowableValues="") - String id; - - - @ApiModelProperty(notes="执行人",allowEmptyValue=true,example="",allowableValues="") - String execUserid; - - @ApiModelProperty(notes="开始时间",allowEmptyValue=true,example="",allowableValues="") - Date startTime; - - @ApiModelProperty(notes="项目编号",allowEmptyValue=true,example="",allowableValues="") - String projectId; - - @ApiModelProperty(notes="项目名称",allowEmptyValue=true,example="",allowableValues="") - String projectName; - - @ApiModelProperty(notes="测试案例编号",allowEmptyValue=true,example="",allowableValues="") - String caseId; - - @ApiModelProperty(notes="测试案例名称",allowEmptyValue=true,example="",allowableValues="") - String caseName; - - @ApiModelProperty(notes="到期时间",allowEmptyValue=true,example="",allowableValues="") - Date endTime; - - @ApiModelProperty(notes="问题描述",allowEmptyValue=true,example="",allowableValues="") - String remark; - - @ApiModelProperty(notes="问题创建人编号",allowEmptyValue=true,example="",allowableValues="") - String createUserid; - - @ApiModelProperty(notes="问题创建人",allowEmptyValue=true,example="",allowableValues="") - String createUsername; - - @ApiModelProperty(notes="创建时间",allowEmptyValue=true,example="",allowableValues="") - Date createTime; - - @ApiModelProperty(notes="0新建1测试中2已完成",allowEmptyValue=true,example="",allowableValues="") - String execStatus; - - @ApiModelProperty(notes="迭代编号",allowEmptyValue=true,example="",allowableValues="") - String iterationId; - - @ApiModelProperty(notes="迭代名称",allowEmptyValue=true,example="",allowableValues="") - String iterationName; - - @ApiModelProperty(notes="执行人姓名",allowEmptyValue=true,example="",allowableValues="") - String execUsername; - - @ApiModelProperty(notes="归属测试任务编号",allowEmptyValue=true,example="",allowableValues="") - String taskId; - - @ApiModelProperty(notes="归属测试任务名称",allowEmptyValue=true,example="",allowableValues="") - String taskName; - - @ApiModelProperty(notes="需求编号",allowEmptyValue=true,example="",allowableValues="") - String menuId; - - @ApiModelProperty(notes="需求名称",allowEmptyValue=true,example="",allowableValues="") - String menuName; - - /**执行编号**/ - public XmTestCaseExec(String id) { - this.id = id; - } - - /**xm_test_case_exec**/ - public XmTestCaseExec() { - } - - /** - * 执行人 - **/ - public void setExecUserid(String execUserid) { - this.execUserid = execUserid; - } - /** - * 开始时间 - **/ - public void setStartTime(Date startTime) { - this.startTime = startTime; - } - /** - * 执行编号 - **/ - public void setId(String id) { - this.id = id; - } - /** - * 项目编号 - **/ - public void setProjectId(String projectId) { - this.projectId = projectId; - } - /** - * 项目名称 - **/ - public void setProjectName(String projectName) { - this.projectName = projectName; - } - /** - * 测试案例编号 - **/ - public void setCaseId(String caseId) { - this.caseId = caseId; - } - /** - * 测试案例名称 - **/ - public void setCaseName(String caseName) { - this.caseName = caseName; - } - /** - * 到期时间 - **/ - public void setEndTime(Date endTime) { - this.endTime = endTime; - } - /** - * 问题描述 - **/ - public void setRemark(String remark) { - this.remark = remark; - } - /** - * 问题创建人编号 - **/ - public void setCreateUserid(String createUserid) { - this.createUserid = createUserid; - } - /** - * 问题创建人 - **/ - public void setCreateUsername(String createUsername) { - this.createUsername = createUsername; - } - /** - * 创建时间 - **/ - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - /** - * 0新建1测试中2已完成 - **/ - public void setExecStatus(String execStatus) { - this.execStatus = execStatus; - } - /** - * 迭代编号 - **/ - public void setIterationId(String iterationId) { - this.iterationId = iterationId; - } - /** - * 迭代名称 - **/ - public void setIterationName(String iterationName) { - this.iterationName = iterationName; - } - /** - * 执行人姓名 - **/ - public void setExecUsername(String execUsername) { - this.execUsername = execUsername; - } - /** - * 归属测试任务编号 - **/ - public void setTaskId(String taskId) { - this.taskId = taskId; - } - /** - * 归属测试任务名称 - **/ - public void setTaskName(String taskName) { - this.taskName = taskName; - } - /** - * 需求编号 - **/ - public void setMenuId(String menuId) { - this.menuId = menuId; - } - /** - * 需求名称 - **/ - public void setMenuName(String menuName) { - this.menuName = menuName; - } - - /** - * 执行人 - **/ - public String getExecUserid() { - return this.execUserid; - } - /** - * 开始时间 - **/ - public Date getStartTime() { - return this.startTime; - } - /** - * 执行编号 - **/ - public String getId() { - return this.id; - } - /** - * 项目编号 - **/ - public String getProjectId() { - return this.projectId; - } - /** - * 项目名称 - **/ - public String getProjectName() { - return this.projectName; - } - /** - * 测试案例编号 - **/ - public String getCaseId() { - return this.caseId; - } - /** - * 测试案例名称 - **/ - public String getCaseName() { - return this.caseName; - } - /** - * 到期时间 - **/ - public Date getEndTime() { - return this.endTime; - } - /** - * 问题描述 - **/ - public String getRemark() { - return this.remark; - } - /** - * 问题创建人编号 - **/ - public String getCreateUserid() { - return this.createUserid; - } - /** - * 问题创建人 - **/ - public String getCreateUsername() { - return this.createUsername; - } - /** - * 创建时间 - **/ - public Date getCreateTime() { - return this.createTime; - } - /** - * 0新建1测试中2已完成 - **/ - public String getExecStatus() { - return this.execStatus; - } - /** - * 迭代编号 - **/ - public String getIterationId() { - return this.iterationId; - } - /** - * 迭代名称 - **/ - public String getIterationName() { - return this.iterationName; - } - /** - * 执行人姓名 - **/ - public String getExecUsername() { - return this.execUsername; - } - /** - * 归属测试任务编号 - **/ - public String getTaskId() { - return this.taskId; - } - /** - * 归属测试任务名称 - **/ - public String getTaskName() { - return this.taskName; - } - /** - * 需求编号 - **/ - public String getMenuId() { - return this.menuId; - } - /** - * 需求名称 - **/ - public String getMenuName() { - return this.menuName; - } - -} \ No newline at end of file diff --git a/xm-core/src/main/java/com/xm/core/service/XmTestCaseExecService.java b/xm-core/src/main/java/com/xm/core/service/XmTestCaseExecService.java deleted file mode 100644 index 704a372a..00000000 --- a/xm-core/src/main/java/com/xm/core/service/XmTestCaseExecService.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.xm.core.service; - -import com.mdp.core.service.BaseService; -import com.xm.core.entity.XmTestCaseExec; -import org.springframework.stereotype.Service; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -/** - * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.
- * 组织 com.qqkj 顶级模块 xm 大模块 core 小模块
- * 实体 XmTestCaseExec 表 XM.xm_test_case_exec 当前主键(包括多主键): id; - ***/ -@Service("xm.core.xmTestCaseExecService") -public class XmTestCaseExecService extends BaseService { - - public List listByProjectAndCaseIds(String projectId, List caseIds) { - // TODO Auto-generated method stub - Map p=new HashMap<>(); - p.put("projectId", projectId); - p.put("caseIds", caseIds.toArray()); - return this.selectList("listByProjectAndCaseIds", p); - } - - /** 请在此类添加自定义函数 */ - -} - diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseExecMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseExecMapper.xml deleted file mode 100644 index 1aa2ea6c..00000000 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmTestCaseExecMapper.xml +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - insert into xm_test_case_exec( - - ) values ( - #{execUserid},#{startTime},#{id},#{projectId},#{projectName},#{caseId},#{caseName},#{endTime},#{remark},#{createUserid},#{createUsername},#{createTime},#{execStatus},#{iterationId},#{iterationName},#{execUsername},#{taskId},#{taskName},#{menuId},#{menuName} - ) - - - - - delete from xm_test_case_exec res - - - - - - - - delete from xm_test_case_exec - where id = #{id} - - - - - update xm_test_case_exec - - - - where id = #{id} - - - - - update xm_test_case_exec - - - - where id = #{id} - - - - - - - - update xm_test_case_exec - set - - where id = #{item.id} - - - - - delete from xm_test_case_exec - where id in - - #{item.id } - - - - - - - exec_userid,start_time,id,project_id,project_name,case_id,case_name,end_time,remark,create_userid,create_username,create_time,exec_status,iteration_id,iteration_name,exec_username,task_id,task_name,menu_id,menu_name - - - - - and res.exec_userid = #{execUserid} - and TO_CHAR(res.start_time,'YYYY-MM-DD') = TO_CHAR(#{startTime},'YYYY-MM-DD') - and res.id = #{id} - and res.project_id = #{projectId} - and res.project_name = #{projectName} - and res.case_id = #{caseId} - and res.case_name = #{caseName} - and TO_CHAR(res.end_time,'YYYY-MM-DD') = TO_CHAR(#{endTime},'YYYY-MM-DD') - and res.remark = #{remark} - and res.create_userid = #{createUserid} - and res.create_username = #{createUsername} - and TO_CHAR(res.create_time,'YYYY-MM-DD') = TO_CHAR(#{createTime},'YYYY-MM-DD') - and res.exec_status = #{execStatus} - and res.iteration_id = #{iterationId} - and res.iteration_name = #{iterationName} - and res.exec_username = #{execUsername} - and res.task_id = #{taskId} - and res.task_name = #{taskName} - and res.menu_id = #{menuId} - and res.menu_name = #{menuName} - - - - exec_userid = #{execUserid}, - start_time = #{startTime}, - project_id = #{projectId}, - project_name = #{projectName}, - case_id = #{caseId}, - case_name = #{caseName}, - end_time = #{endTime}, - remark = #{remark}, - create_userid = #{createUserid}, - create_username = #{createUsername}, - create_time = #{createTime}, - exec_status = #{execStatus}, - iteration_id = #{iterationId}, - iteration_name = #{iterationName}, - exec_username = #{execUsername}, - task_id = #{taskId}, - task_name = #{taskName}, - menu_id = #{menuId}, - menu_name = #{menuName} - - - exec_userid = #{execUserid}, - start_time = #{startTime}, - project_id = #{projectId}, - project_name = #{projectName}, - case_id = #{caseId}, - case_name = #{caseName}, - end_time = #{endTime}, - remark = #{remark}, - create_userid = #{createUserid}, - create_username = #{createUsername}, - create_time = #{createTime}, - exec_status = #{execStatus}, - iteration_id = #{iterationId}, - iteration_name = #{iterationName}, - exec_username = #{execUsername}, - task_id = #{taskId}, - task_name = #{taskName}, - menu_id = #{menuId}, - menu_name = #{menuName}, - - - - exec_userid = #{item.execUserid}, - start_time = #{item.startTime}, - project_id = #{item.projectId}, - project_name = #{item.projectName}, - case_id = #{item.caseId}, - case_name = #{item.caseName}, - end_time = #{item.endTime}, - remark = #{item.remark}, - create_userid = #{item.createUserid}, - create_username = #{item.createUsername}, - create_time = #{item.createTime}, - exec_status = #{item.execStatus}, - iteration_id = #{item.iterationId}, - iteration_name = #{item.iterationName}, - exec_username = #{item.execUsername}, - task_id = #{item.taskId}, - task_name = #{item.taskName}, - menu_id = #{item.menuId}, - menu_name = #{item.menuName} - - \ No newline at end of file