diff --git a/xm-core/src/main/java/com/xm/core/ctrl/XmIterationProductLinkController.java b/xm-core/src/main/java/com/xm/core/ctrl/XmIterationProductLinkController.java new file mode 100644 index 00000000..4d63a0da --- /dev/null +++ b/xm-core/src/main/java/com/xm/core/ctrl/XmIterationProductLinkController.java @@ -0,0 +1,188 @@ +package com.xm.core.ctrl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +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.ModelAttribute; +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 org.springframework.stereotype.Controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; + +import com.mdp.mybatis.PageUtils; +import com.mdp.core.entity.Tips; +import com.mdp.core.err.BizException; +import com.mdp.core.utils.BaseUtils; +import com.mdp.core.utils.RequestUtils; +import com.xm.core.service.XmIterationProductLinkService; +import com.xm.core.entity.XmIterationProductLink; +/** + * url编制采用rest风格,如对XM.xm_iteration_product_link 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表的操作有增删改查,对应的url分别为:
+ * 新增: core/xmIterationProductLink/add
+ * 查询: core/xmIterationProductLink/list
+ * 模糊查询: core/xmIterationProductLink/listKey
+ * 修改: core/xmIterationProductLink/edit
+ * 删除: core/xmIterationProductLink/del
+ * 批量删除: core/xmIterationProductLink/batchDel
+ * 组织 com 顶级模块 xm 大模块 core 小模块
+ * 实体 XmIterationProductLink 表 XM.xm_iteration_product_link 当前主键(包括多主键): iteration_id,product_id; + ***/ +@RestController("xm.core.xmIterationProductLinkController") +@RequestMapping(value="/**/core/xmIterationProductLink") +@Api(tags={"迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表操作接口"}) +public class XmIterationProductLinkController { + + static Logger logger =LoggerFactory.getLogger(XmIterationProductLinkController.class); + + @Autowired + private XmIterationProductLinkService xmIterationProductLinkService; + + + + + @ApiOperation( value = "查询迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表信息列表",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200,response=XmIterationProductLink.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}") + }) + @RequestMapping(value="/list",method=RequestMethod.GET) + public Map listXmIterationProductLink( @RequestParam Map xmIterationProductLink){ + Map m = new HashMap<>(); + RequestUtils.transformArray(xmIterationProductLink, "iterationIdsproductIds"); + PageUtils.startPage(xmIterationProductLink); + List> xmIterationProductLinkList = xmIterationProductLinkService.selectListMapByWhere(xmIterationProductLink); //列出XmIterationProductLink列表 + PageUtils.responePage(m, xmIterationProductLinkList); + m.put("data",xmIterationProductLinkList); + Tips tips=new Tips("查询成功"); + m.put("tips", tips); + return m; + } + + + + /** + @ApiOperation( value = "新增一条迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表信息",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200,response=XmIterationProductLink.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") + }) + @RequestMapping(value="/add",method=RequestMethod.POST) + public Map addXmIterationProductLink(@RequestBody XmIterationProductLink xmIterationProductLink) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功新增一条数据"); + try{ + boolean createPk=false; + if(StringUtils.isEmpty(xmIterationProductLink.getIterationId())) { + createPk=true; + xmIterationProductLink.setIterationId(xmIterationProductLinkService.createKey("iterationId")); + } + if(StringUtils.isEmpty(xmIterationProductLink.getProductId())) { + createPk=true; + xmIterationProductLink.setProductId(xmIterationProductLinkService.createKey("productId")); + } + if(createPk==false){ + if(xmIterationProductLinkService.selectOneObject(xmIterationProductLink) !=null ){ + tips.setFailureMsg("编号重复,请修改编号再提交"); + m.put("tips", tips); + return m; + } + } + xmIterationProductLinkService.insert(xmIterationProductLink); + m.put("data",xmIterationProductLink); + }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 = "删除一条迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表信息",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}") + }) + @RequestMapping(value="/del",method=RequestMethod.POST) + public Map delXmIterationProductLink(@RequestBody XmIterationProductLink xmIterationProductLink){ + Map m = new HashMap<>(); + Tips tips=new Tips("成功删除一条数据"); + try{ + xmIterationProductLinkService.deleteByPk(xmIterationProductLink); + }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 = "根据主键修改一条迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表信息",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200,response=XmIterationProductLink.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") + }) + @RequestMapping(value="/edit",method=RequestMethod.POST) + public Map editXmIterationProductLink(@RequestBody XmIterationProductLink xmIterationProductLink) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功更新一条数据"); + try{ + xmIterationProductLinkService.updateByPk(xmIterationProductLink); + m.put("data",xmIterationProductLink); + }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 = "根据主键列表批量删除迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表信息",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") + }) + @RequestMapping(value="/batchDel",method=RequestMethod.POST) + public Map batchDelXmIterationProductLink(@RequestBody List xmIterationProductLinks) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功删除"+xmIterationProductLinks.size()+"条数据"); + try{ + xmIterationProductLinkService.batchDelete(xmIterationProductLinks); + }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/XmProductProjectLinkController.java b/xm-core/src/main/java/com/xm/core/ctrl/XmProductProjectLinkController.java new file mode 100644 index 00000000..d03fe7a6 --- /dev/null +++ b/xm-core/src/main/java/com/xm/core/ctrl/XmProductProjectLinkController.java @@ -0,0 +1,184 @@ +package com.xm.core.ctrl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +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.ModelAttribute; +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 org.springframework.stereotype.Controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; + +import com.mdp.mybatis.PageUtils; +import com.mdp.core.entity.Tips; +import com.mdp.core.err.BizException; +import com.mdp.core.utils.BaseUtils; +import com.mdp.core.utils.RequestUtils; +import com.xm.core.service.XmProductProjectLinkService; +import com.xm.core.entity.XmProductProjectLink; +/** + * url编制采用rest风格,如对XM.xm_product_project_link 产品与项目的关联关系表,一般由产品经理挂接项目到产品上的操作有增删改查,对应的url分别为:
+ * 新增: core/xmProductProjectLink/add
+ * 查询: core/xmProductProjectLink/list
+ * 模糊查询: core/xmProductProjectLink/listKey
+ * 修改: core/xmProductProjectLink/edit
+ * 删除: core/xmProductProjectLink/del
+ * 批量删除: core/xmProductProjectLink/batchDel
+ * 组织 com 顶级模块 xm 大模块 core 小模块
+ * 实体 XmProductProjectLink 表 XM.xm_product_project_link 当前主键(包括多主键): project_id; + ***/ +@RestController("xm.core.xmProductProjectLinkController") +@RequestMapping(value="/**/core/xmProductProjectLink") +@Api(tags={"产品与项目的关联关系表,一般由产品经理挂接项目到产品上操作接口"}) +public class XmProductProjectLinkController { + + static Logger logger =LoggerFactory.getLogger(XmProductProjectLinkController.class); + + @Autowired + private XmProductProjectLinkService xmProductProjectLinkService; + + + + + @ApiOperation( value = "查询产品与项目的关联关系表,一般由产品经理挂接项目到产品上信息列表",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200,response=XmProductProjectLink.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}") + }) + @RequestMapping(value="/list",method=RequestMethod.GET) + public Map listXmProductProjectLink( @RequestParam Map xmProductProjectLink){ + Map m = new HashMap<>(); + RequestUtils.transformArray(xmProductProjectLink, "projectIds"); + PageUtils.startPage(xmProductProjectLink); + List> xmProductProjectLinkList = xmProductProjectLinkService.selectListMapByWhere(xmProductProjectLink); //列出XmProductProjectLink列表 + PageUtils.responePage(m, xmProductProjectLinkList); + m.put("data",xmProductProjectLinkList); + Tips tips=new Tips("查询成功"); + m.put("tips", tips); + return m; + } + + + + /** + @ApiOperation( value = "新增一条产品与项目的关联关系表,一般由产品经理挂接项目到产品上信息",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200,response=XmProductProjectLink.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") + }) + @RequestMapping(value="/add",method=RequestMethod.POST) + public Map addXmProductProjectLink(@RequestBody XmProductProjectLink xmProductProjectLink) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功新增一条数据"); + try{ + boolean createPk=false; + if(StringUtils.isEmpty(xmProductProjectLink.getProjectId())) { + createPk=true; + xmProductProjectLink.setProjectId(xmProductProjectLinkService.createKey("projectId")); + } + if(createPk==false){ + if(xmProductProjectLinkService.selectOneObject(xmProductProjectLink) !=null ){ + tips.setFailureMsg("编号重复,请修改编号再提交"); + m.put("tips", tips); + return m; + } + } + xmProductProjectLinkService.insert(xmProductProjectLink); + m.put("data",xmProductProjectLink); + }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 = "删除一条产品与项目的关联关系表,一般由产品经理挂接项目到产品上信息",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}") + }) + @RequestMapping(value="/del",method=RequestMethod.POST) + public Map delXmProductProjectLink(@RequestBody XmProductProjectLink xmProductProjectLink){ + Map m = new HashMap<>(); + Tips tips=new Tips("成功删除一条数据"); + try{ + xmProductProjectLinkService.deleteByPk(xmProductProjectLink); + }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 = "根据主键修改一条产品与项目的关联关系表,一般由产品经理挂接项目到产品上信息",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200,response=XmProductProjectLink.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") + }) + @RequestMapping(value="/edit",method=RequestMethod.POST) + public Map editXmProductProjectLink(@RequestBody XmProductProjectLink xmProductProjectLink) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功更新一条数据"); + try{ + xmProductProjectLinkService.updateByPk(xmProductProjectLink); + m.put("data",xmProductProjectLink); + }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 = "根据主键列表批量删除产品与项目的关联关系表,一般由产品经理挂接项目到产品上信息",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") + }) + @RequestMapping(value="/batchDel",method=RequestMethod.POST) + public Map batchDelXmProductProjectLink(@RequestBody List xmProductProjectLinks) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功删除"+xmProductProjectLinks.size()+"条数据"); + try{ + xmProductProjectLinkService.batchDelete(xmProductProjectLinks); + }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/entity/XmIterationProductLink.java b/xm-core/src/main/java/com/xm/core/entity/XmIterationProductLink.java new file mode 100644 index 00000000..a065539c --- /dev/null +++ b/xm-core/src/main/java/com/xm/core/entity/XmIterationProductLink.java @@ -0,0 +1,124 @@ +package com.xm.core.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; + +/** + * 组织 com 顶级模块 xm 大模块 core 小模块
+ * 实体 XmIterationProductLink所有属性名:
+ * iterationId,productId,ctime,cuserid,cusername,linkStatus;
+ * 表 XM.xm_iteration_product_link 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表的所有字段名:
+ * iteration_id,product_id,ctime,cuserid,cusername,link_status;
+ * 当前主键(包括多主键):
+ * iteration_id,product_id;
+ */ +@ApiModel(description="迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表") +public class XmIterationProductLink implements java.io.Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(notes="迭代表主键,主键",allowEmptyValue=true,example="",allowableValues="") + String iterationId; + + @ApiModelProperty(notes="产品表主键,主键",allowEmptyValue=true,example="",allowableValues="") + String productId; + + + @ApiModelProperty(notes="创建时间",allowEmptyValue=true,example="",allowableValues="") + Date ctime; + + @ApiModelProperty(notes="创建人编号",allowEmptyValue=true,example="",allowableValues="") + String cuserid; + + @ApiModelProperty(notes="创建人姓名",allowEmptyValue=true,example="",allowableValues="") + String cusername; + + @ApiModelProperty(notes="关联状态1关联0取消关联",allowEmptyValue=true,example="",allowableValues="") + String linkStatus; + + /**迭代表主键,产品表主键**/ + public XmIterationProductLink(String iterationId,String productId) { + this.iterationId = iterationId; + this.productId = productId; + } + + /**迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表**/ + public XmIterationProductLink() { + } + + /** + * 迭代表主键 + **/ + public void setIterationId(String iterationId) { + this.iterationId = iterationId; + } + /** + * 产品表主键 + **/ + public void setProductId(String productId) { + this.productId = productId; + } + /** + * 创建时间 + **/ + public void setCtime(Date ctime) { + this.ctime = ctime; + } + /** + * 创建人编号 + **/ + public void setCuserid(String cuserid) { + this.cuserid = cuserid; + } + /** + * 创建人姓名 + **/ + public void setCusername(String cusername) { + this.cusername = cusername; + } + /** + * 关联状态1关联0取消关联 + **/ + public void setLinkStatus(String linkStatus) { + this.linkStatus = linkStatus; + } + + /** + * 迭代表主键 + **/ + public String getIterationId() { + return this.iterationId; + } + /** + * 产品表主键 + **/ + public String getProductId() { + return this.productId; + } + /** + * 创建时间 + **/ + public Date getCtime() { + return this.ctime; + } + /** + * 创建人编号 + **/ + public String getCuserid() { + return this.cuserid; + } + /** + * 创建人姓名 + **/ + public String getCusername() { + return this.cusername; + } + /** + * 关联状态1关联0取消关联 + **/ + public String getLinkStatus() { + return this.linkStatus; + } + +} \ No newline at end of file diff --git a/xm-core/src/main/java/com/xm/core/entity/XmProductProjectLink.java b/xm-core/src/main/java/com/xm/core/entity/XmProductProjectLink.java new file mode 100644 index 00000000..2053a9ed --- /dev/null +++ b/xm-core/src/main/java/com/xm/core/entity/XmProductProjectLink.java @@ -0,0 +1,123 @@ +package com.xm.core.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; + +/** + * 组织 com 顶级模块 xm 大模块 core 小模块
+ * 实体 XmProductProjectLink所有属性名:
+ * projectId,productId,ctime,cuserid,cusername,linkStatus;
+ * 表 XM.xm_product_project_link 产品与项目的关联关系表,一般由产品经理挂接项目到产品上的所有字段名:
+ * project_id,product_id,ctime,cuserid,cusername,link_status;
+ * 当前主键(包括多主键):
+ * project_id;
+ */ +@ApiModel(description="产品与项目的关联关系表,一般由产品经理挂接项目到产品上") +public class XmProductProjectLink implements java.io.Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(notes="项目表中的主键,主键",allowEmptyValue=true,example="",allowableValues="") + String projectId; + + + @ApiModelProperty(notes="产品表中的主键",allowEmptyValue=true,example="",allowableValues="") + String productId; + + @ApiModelProperty(notes="创建时间",allowEmptyValue=true,example="",allowableValues="") + Date ctime; + + @ApiModelProperty(notes="创建人编号",allowEmptyValue=true,example="",allowableValues="") + String cuserid; + + @ApiModelProperty(notes="创建人姓名",allowEmptyValue=true,example="",allowableValues="") + String cusername; + + @ApiModelProperty(notes="关联状态1关联0取消关联",allowEmptyValue=true,example="",allowableValues="") + String linkStatus; + + /**项目表中的主键**/ + public XmProductProjectLink(String projectId) { + this.projectId = projectId; + } + + /**产品与项目的关联关系表,一般由产品经理挂接项目到产品上**/ + public XmProductProjectLink() { + } + + /** + * 项目表中的主键 + **/ + public void setProjectId(String projectId) { + this.projectId = projectId; + } + /** + * 产品表中的主键 + **/ + public void setProductId(String productId) { + this.productId = productId; + } + /** + * 创建时间 + **/ + public void setCtime(Date ctime) { + this.ctime = ctime; + } + /** + * 创建人编号 + **/ + public void setCuserid(String cuserid) { + this.cuserid = cuserid; + } + /** + * 创建人姓名 + **/ + public void setCusername(String cusername) { + this.cusername = cusername; + } + /** + * 关联状态1关联0取消关联 + **/ + public void setLinkStatus(String linkStatus) { + this.linkStatus = linkStatus; + } + + /** + * 项目表中的主键 + **/ + public String getProjectId() { + return this.projectId; + } + /** + * 产品表中的主键 + **/ + public String getProductId() { + return this.productId; + } + /** + * 创建时间 + **/ + public Date getCtime() { + return this.ctime; + } + /** + * 创建人编号 + **/ + public String getCuserid() { + return this.cuserid; + } + /** + * 创建人姓名 + **/ + public String getCusername() { + return this.cusername; + } + /** + * 关联状态1关联0取消关联 + **/ + public String getLinkStatus() { + return this.linkStatus; + } + +} \ No newline at end of file diff --git a/xm-core/src/main/java/com/xm/core/service/XmIterationProductLinkService.java b/xm-core/src/main/java/com/xm/core/service/XmIterationProductLinkService.java new file mode 100644 index 00000000..190167fb --- /dev/null +++ b/xm-core/src/main/java/com/xm/core/service/XmIterationProductLinkService.java @@ -0,0 +1,21 @@ +package com.xm.core.service; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.util.List; +import java.util.Map; +import org.springframework.stereotype.Service; +import com.mdp.core.service.BaseService; +import com.xm.core.entity.XmIterationProductLink; +/** + * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.
+ * 组织 com 顶级模块 xm 大模块 core 小模块
+ * 实体 XmIterationProductLink 表 XM.xm_iteration_product_link 当前主键(包括多主键): iteration_id,product_id; + ***/ +@Service("xm.core.xmIterationProductLinkService") +public class XmIterationProductLinkService extends BaseService { + static Logger logger =LoggerFactory.getLogger(XmIterationProductLinkService.class); + /** 请在此类添加自定义函数 */ + +} + diff --git a/xm-core/src/main/java/com/xm/core/service/XmProductProjectLinkService.java b/xm-core/src/main/java/com/xm/core/service/XmProductProjectLinkService.java new file mode 100644 index 00000000..0a1fce30 --- /dev/null +++ b/xm-core/src/main/java/com/xm/core/service/XmProductProjectLinkService.java @@ -0,0 +1,21 @@ +package com.xm.core.service; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.util.List; +import java.util.Map; +import org.springframework.stereotype.Service; +import com.mdp.core.service.BaseService; +import com.xm.core.entity.XmProductProjectLink; +/** + * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.
+ * 组织 com 顶级模块 xm 大模块 core 小模块
+ * 实体 XmProductProjectLink 表 XM.xm_product_project_link 当前主键(包括多主键): project_id; + ***/ +@Service("xm.core.xmProductProjectLinkService") +public class XmProductProjectLinkService extends BaseService { + static Logger logger =LoggerFactory.getLogger(XmProductProjectLinkService.class); + /** 请在此类添加自定义函数 */ + +} + diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationProductLinkMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationProductLinkMapper.xml new file mode 100644 index 00000000..fc8d8a1c --- /dev/null +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmIterationProductLinkMapper.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into XM.xm_iteration_product_link( + + ) values ( + #{iterationId},#{productId},#{ctime},#{cuserid},#{cusername},#{linkStatus} + ) + + + + + delete from XM.xm_iteration_product_link + + 1=2 + + + + + + delete from XM.xm_iteration_product_link + where iteration_id = #{iterationId} and product_id = #{productId} + + + + + update XM.xm_iteration_product_link + + + + where iteration_id = #{iterationId} and product_id = #{productId} + + + + + update XM.xm_iteration_product_link + + + + where iteration_id = #{iterationId} and product_id = #{productId} + + + + + + + + update XM.xm_iteration_product_link + set + + where iteration_id = #{item.iterationId} and product_id = #{item.productId} + + + + + delete from XM.xm_iteration_product_link + where + (iteration_id, product_id) + in + + ( #{item.iterationId}, #{item.productId} + ) + + + + + + + iteration_id,product_id,ctime,cuserid,cusername,link_status + + + + + and res.iteration_id = #{iterationId} + and res.product_id = #{productId} + and date_format(res.ctime,'%Y-%m-%d') = date_format(#{ctime},'%Y-%m-%d') + and res.cuserid = #{cuserid} + and res.cusername = #{cusername} + and res.link_status = #{linkStatus} + + + + ctime = #{ctime}, + cuserid = #{cuserid}, + cusername = #{cusername}, + link_status = #{linkStatus} + + + ctime = #{ctime}, + cuserid = #{cuserid}, + cusername = #{cusername}, + link_status = #{linkStatus}, + + + + ctime = #{item.ctime}, + cuserid = #{item.cuserid}, + cusername = #{item.cusername}, + link_status = #{item.linkStatus} + + \ No newline at end of file diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml index 60f1a151..ced28165 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductMapper.xml @@ -24,7 +24,7 @@ ) - and exists( select 1 from xm_iteration_menu im where im.product_id =res.id ) + and exists( select 1 from xm_iteration_menu im where im.product_id =res.id and im.iteration_id=#{iterationId} ) and res.product_name like #{key} diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductProjectLinkMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductProjectLinkMapper.xml new file mode 100644 index 00000000..8bd2e863 --- /dev/null +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProductProjectLinkMapper.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into XM.xm_product_project_link( + + ) values ( + #{projectId},#{productId},#{ctime},#{cuserid},#{cusername},#{linkStatus} + ) + + + + + delete from XM.xm_product_project_link + + 1=2 + + + + + + delete from XM.xm_product_project_link + where project_id = #{projectId} + + + + + update XM.xm_product_project_link + + + + where project_id = #{projectId} + + + + + update XM.xm_product_project_link + + + + where project_id = #{projectId} + + + + + + + + update XM.xm_product_project_link + set + + where project_id = #{item.projectId} + + + + + delete from XM.xm_product_project_link + where + (project_id) + in + + ( #{item.projectId} + ) + + + + + + + project_id,product_id,ctime,cuserid,cusername,link_status + + + + + and res.project_id = #{projectId} + and res.product_id = #{productId} + and date_format(res.ctime,'%Y-%m-%d') = date_format(#{ctime},'%Y-%m-%d') + and res.cuserid = #{cuserid} + and res.cusername = #{cusername} + and res.link_status = #{linkStatus} + + + + product_id = #{productId}, + ctime = #{ctime}, + cuserid = #{cuserid}, + cusername = #{cusername}, + link_status = #{linkStatus} + + + product_id = #{productId}, + ctime = #{ctime}, + cuserid = #{cuserid}, + cusername = #{cusername}, + link_status = #{linkStatus}, + + + + product_id = #{item.productId}, + ctime = #{item.ctime}, + cuserid = #{item.cuserid}, + cusername = #{item.cusername}, + link_status = #{item.linkStatus} + + \ No newline at end of file diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectPhaseMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectPhaseMapper.xml index 8d2af08c..218d3910 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectPhaseMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmProjectPhaseMapper.xml @@ -67,6 +67,9 @@ + + and exists( select 1 from xm_task t inner join xm_iteration_menu im on t.menu_id=im.menu_id where t.project_phase_id=res.id and im.iteration_id=#{iterationId}) + order by res.seq_no asc diff --git a/xm-core/src/test/java/com/xm/core/ctrl/TestXmIterationProductLinkController.java b/xm-core/src/test/java/com/xm/core/ctrl/TestXmIterationProductLinkController.java new file mode 100644 index 00000000..c787b2bf --- /dev/null +++ b/xm-core/src/test/java/com/xm/core/ctrl/TestXmIterationProductLinkController.java @@ -0,0 +1,127 @@ +package com.xm.core.ctrl; + +import java.text.SimpleDateFormat; +import java.util.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*; +import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.mock.web.MockHttpServletResponse; +import org.springframework.mock.web.MockHttpSession; +import org.springframework.mock.web.MockServletContext; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.request.ServletWebRequest; +import org.springframework.boot.test.context.SpringBootTest; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.http.MediaType; +import com.xm.core.entity.XmIterationProductLink; +import com.mdp.core.utils.BaseUtils; +/** + * 组织 com
+ * 顶级模块 xm
+ * 大模块 core
+ * 小模块
+ * 表 XM.xm_iteration_product_link 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表
+ * 实体 XmIterationProductLink
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * iterationId,productId,ctime,cuserid,cusername,linkStatus;
+ * 当前表的所有字段名:
+ * iteration_id,product_id,ctime,cuserid,cusername,link_status;
+ * 当前主键(包括多主键):
+ * iteration_id,product_id;
+ **/ +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest +public class TestXmIterationProductLinkController { + + @Autowired + public WebApplicationContext wac; // cached + @Autowired + public MockServletContext servletContext; // cached + @Autowired + public MockHttpSession session; + @Autowired + public MockHttpServletRequest request; + @Autowired + public MockHttpServletResponse response; + @Autowired + public ServletWebRequest webRequest; + + public MockMvc mockMvc; + + public MockHttpServletRequestBuilder msrb; + + ObjectMapper om = new ObjectMapper(); + + @Before + public void setup() { + this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); + } + + @Test + public void add() throws Exception { + Map p=BaseUtils.map("iterationId","BcN5","productId","7rUG","ctime",new Date("2021-07-17 20:28:11"),"cuserid","UpT2","cusername","y2y7","linkStatus","p"); + XmIterationProductLink xmIterationProductLink=BaseUtils.fromMap(p,XmIterationProductLink.class); + String jsonXmIterationProductLink=om.writeValueAsString(xmIterationProductLink); + mockMvc.perform( post("/**/core/xmIterationProductLink/add").content(jsonXmIterationProductLink).contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + + @Test + public void list() throws Exception { + mockMvc.perform( get("/**/core/xmIterationProductLink/list") + .param("iterationId","BcN5").param("currentPage", "1").param("pageSize", "10")) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)) + .andExpect(jsonPath("data").isArray()) + .andExpect(jsonPath("total").exists()); + } + + @Test + public void edit() throws Exception { + Map p=BaseUtils.map("iterationId","BcN5","productId","7rUG","ctime",new Date("2021-07-17 20:28:11"),"cuserid","UpT2","cusername","y2y7","linkStatus","p"); + XmIterationProductLink xmIterationProductLink=BaseUtils.fromMap(p,XmIterationProductLink.class); + String jsonXmIterationProductLink=om.writeValueAsString(xmIterationProductLink); + mockMvc.perform( post("/**/core/xmIterationProductLink/edit").content(jsonXmIterationProductLink).contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + + @Test + public void del() throws Exception { + mockMvc.perform( post("/**/core/xmIterationProductLink/del").content("BcN5").contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + + @Test + public void batchDel() throws Exception { + Map p=BaseUtils.map("iterationId","BcN5","productId","7rUG","ctime",new Date("2021-07-17 20:28:11"),"cuserid","UpT2","cusername","y2y7","linkStatus","p"); + XmIterationProductLink xmIterationProductLink=BaseUtils.fromMap(p,XmIterationProductLink.class); + List xmIterationProductLinks=new ArrayList<>(); + xmIterationProductLinks.add(xmIterationProductLink); + String jsonXmIterationProductLink=om.writeValueAsString(xmIterationProductLinks); + mockMvc.perform( post("/**/core/xmIterationProductLink/batchDel").content(jsonXmIterationProductLink).contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + +} diff --git a/xm-core/src/test/java/com/xm/core/ctrl/TestXmProductProjectLinkController.java b/xm-core/src/test/java/com/xm/core/ctrl/TestXmProductProjectLinkController.java new file mode 100644 index 00000000..17c63d65 --- /dev/null +++ b/xm-core/src/test/java/com/xm/core/ctrl/TestXmProductProjectLinkController.java @@ -0,0 +1,127 @@ +package com.xm.core.ctrl; + +import java.text.SimpleDateFormat; +import java.util.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*; +import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.mock.web.MockHttpServletResponse; +import org.springframework.mock.web.MockHttpSession; +import org.springframework.mock.web.MockServletContext; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.request.ServletWebRequest; +import org.springframework.boot.test.context.SpringBootTest; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.http.MediaType; +import com.xm.core.entity.XmProductProjectLink; +import com.mdp.core.utils.BaseUtils; +/** + * 组织 com
+ * 顶级模块 xm
+ * 大模块 core
+ * 小模块
+ * 表 XM.xm_product_project_link 产品与项目的关联关系表,一般由产品经理挂接项目到产品上
+ * 实体 XmProductProjectLink
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * projectId,productId,ctime,cuserid,cusername,linkStatus;
+ * 当前表的所有字段名:
+ * project_id,product_id,ctime,cuserid,cusername,link_status;
+ * 当前主键(包括多主键):
+ * project_id;
+ **/ +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest +public class TestXmProductProjectLinkController { + + @Autowired + public WebApplicationContext wac; // cached + @Autowired + public MockServletContext servletContext; // cached + @Autowired + public MockHttpSession session; + @Autowired + public MockHttpServletRequest request; + @Autowired + public MockHttpServletResponse response; + @Autowired + public ServletWebRequest webRequest; + + public MockMvc mockMvc; + + public MockHttpServletRequestBuilder msrb; + + ObjectMapper om = new ObjectMapper(); + + @Before + public void setup() { + this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); + } + + @Test + public void add() throws Exception { + Map p=BaseUtils.map("projectId","b1g5","productId","V9Uu","ctime",new Date("2021-07-17 20:28:11"),"cuserid","uw3F","cusername","sPev","linkStatus","1"); + XmProductProjectLink xmProductProjectLink=BaseUtils.fromMap(p,XmProductProjectLink.class); + String jsonXmProductProjectLink=om.writeValueAsString(xmProductProjectLink); + mockMvc.perform( post("/**/core/xmProductProjectLink/add").content(jsonXmProductProjectLink).contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + + @Test + public void list() throws Exception { + mockMvc.perform( get("/**/core/xmProductProjectLink/list") + .param("projectId","b1g5").param("currentPage", "1").param("pageSize", "10")) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)) + .andExpect(jsonPath("data").isArray()) + .andExpect(jsonPath("total").exists()); + } + + @Test + public void edit() throws Exception { + Map p=BaseUtils.map("projectId","b1g5","productId","V9Uu","ctime",new Date("2021-07-17 20:28:11"),"cuserid","uw3F","cusername","sPev","linkStatus","1"); + XmProductProjectLink xmProductProjectLink=BaseUtils.fromMap(p,XmProductProjectLink.class); + String jsonXmProductProjectLink=om.writeValueAsString(xmProductProjectLink); + mockMvc.perform( post("/**/core/xmProductProjectLink/edit").content(jsonXmProductProjectLink).contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + + @Test + public void del() throws Exception { + mockMvc.perform( post("/**/core/xmProductProjectLink/del").content("b1g5").contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + + @Test + public void batchDel() throws Exception { + Map p=BaseUtils.map("projectId","b1g5","productId","V9Uu","ctime",new Date("2021-07-17 20:28:11"),"cuserid","uw3F","cusername","sPev","linkStatus","1"); + XmProductProjectLink xmProductProjectLink=BaseUtils.fromMap(p,XmProductProjectLink.class); + List xmProductProjectLinks=new ArrayList<>(); + xmProductProjectLinks.add(xmProductProjectLink); + String jsonXmProductProjectLink=om.writeValueAsString(xmProductProjectLinks); + mockMvc.perform( post("/**/core/xmProductProjectLink/batchDel").content(jsonXmProductProjectLink).contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + +} diff --git a/xm-core/src/test/java/com/xm/core/dao/TestXmIterationProductLinkDao.java b/xm-core/src/test/java/com/xm/core/dao/TestXmIterationProductLinkDao.java new file mode 100644 index 00000000..efd3dd7c --- /dev/null +++ b/xm-core/src/test/java/com/xm/core/dao/TestXmIterationProductLinkDao.java @@ -0,0 +1,51 @@ +package com.xm.core.dao; + +import java.util.*; +import java.text.SimpleDateFormat; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.ContextHierarchy; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import com.mdp.core.utils.BaseUtils; +import org.springframework.beans.factory.annotation.Autowired; +import com.mdp.core.dao.BaseDao; +import com.mdp.mybatis.PageUtils; +import com.github.pagehelper.Page; +import com.xm.core.entity.XmIterationProductLink; +import org.springframework.boot.test.context.SpringBootTest; +/** + * XmIterationProductLinkDao的测试案例 + * 组织 com
+ * 顶级模块 xm
+ * 大模块 core
+ * 小模块
+ * 表 XM.xm_iteration_product_link 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表
+ * 实体 XmIterationProductLink
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * iterationId,productId,ctime,cuserid,cusername,linkStatus;
+ * 当前表的所有字段名:
+ * iteration_id,product_id,ctime,cuserid,cusername,link_status;
+ * 当前主键(包括多主键):
+ * iteration_id,product_id;
+ ***/ + @RunWith(SpringJUnit4ClassRunner.class) + @SpringBootTest +public class TestXmIterationProductLinkDao { + + @Autowired + BaseDao baseDao; + + /** + * 新增一条数据 + ***/ + @Test + public void insert() { + Map p=BaseUtils.map("iterationId","BcN5","productId","7rUG","ctime",new Date("2021-07-17 20:28:11"),"cuserid","UpT2","cusername","y2y7","linkStatus","p"); + XmIterationProductLink xmIterationProductLink=BaseUtils.fromMap(p,XmIterationProductLink.class); + baseDao.insert(xmIterationProductLink); + //Assert.assertEquals(1, result); + } +} diff --git a/xm-core/src/test/java/com/xm/core/dao/TestXmProductProjectLinkDao.java b/xm-core/src/test/java/com/xm/core/dao/TestXmProductProjectLinkDao.java new file mode 100644 index 00000000..8d23f28f --- /dev/null +++ b/xm-core/src/test/java/com/xm/core/dao/TestXmProductProjectLinkDao.java @@ -0,0 +1,51 @@ +package com.xm.core.dao; + +import java.util.*; +import java.text.SimpleDateFormat; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.ContextHierarchy; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import com.mdp.core.utils.BaseUtils; +import org.springframework.beans.factory.annotation.Autowired; +import com.mdp.core.dao.BaseDao; +import com.mdp.mybatis.PageUtils; +import com.github.pagehelper.Page; +import com.xm.core.entity.XmProductProjectLink; +import org.springframework.boot.test.context.SpringBootTest; +/** + * XmProductProjectLinkDao的测试案例 + * 组织 com
+ * 顶级模块 xm
+ * 大模块 core
+ * 小模块
+ * 表 XM.xm_product_project_link 产品与项目的关联关系表,一般由产品经理挂接项目到产品上
+ * 实体 XmProductProjectLink
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * projectId,productId,ctime,cuserid,cusername,linkStatus;
+ * 当前表的所有字段名:
+ * project_id,product_id,ctime,cuserid,cusername,link_status;
+ * 当前主键(包括多主键):
+ * project_id;
+ ***/ + @RunWith(SpringJUnit4ClassRunner.class) + @SpringBootTest +public class TestXmProductProjectLinkDao { + + @Autowired + BaseDao baseDao; + + /** + * 新增一条数据 + ***/ + @Test + public void insert() { + Map p=BaseUtils.map("projectId","b1g5","productId","V9Uu","ctime",new Date("2021-07-17 20:28:11"),"cuserid","uw3F","cusername","sPev","linkStatus","1"); + XmProductProjectLink xmProductProjectLink=BaseUtils.fromMap(p,XmProductProjectLink.class); + baseDao.insert(xmProductProjectLink); + //Assert.assertEquals(1, result); + } +} diff --git a/xm-core/src/test/java/com/xm/core/service/TestXmIterationProductLinkService.java b/xm-core/src/test/java/com/xm/core/service/TestXmIterationProductLinkService.java new file mode 100644 index 00000000..81ed8568 --- /dev/null +++ b/xm-core/src/test/java/com/xm/core/service/TestXmIterationProductLinkService.java @@ -0,0 +1,53 @@ +package com.xm.core.service; + +import java.util.*; +import java.text.SimpleDateFormat; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.ContextHierarchy; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import com.mdp.core.utils.BaseUtils; +import org.springframework.beans.factory.annotation.Autowired; +import com.xm.core.service.XmIterationProductLinkService; +import com.mdp.mybatis.PageUtils; +import com.github.pagehelper.Page; +import com.xm.core.entity.XmIterationProductLink; +import org.springframework.boot.test.context.SpringBootTest; +/** + * XmIterationProductLinkService的测试案例 + * 组织 com
+ * 顶级模块 xm
+ * 大模块 core
+ * 小模块
+ * 表 XM.xm_iteration_product_link 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表
+ * 实体 XmIterationProductLink
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * iterationId,productId,ctime,cuserid,cusername,linkStatus;
+ * 当前表的所有字段名:
+ * iteration_id,product_id,ctime,cuserid,cusername,link_status;
+ * 当前主键(包括多主键):
+ * iteration_id,product_id;
+ ***/ + +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest +public class TestXmIterationProductLinkService { + + @Autowired + XmIterationProductLinkService xmIterationProductLinkService; + + /** + * 新增一条数据 + ***/ + @Test + public void insert() { + Map p=BaseUtils.map("iterationId","BcN5","productId","7rUG","ctime",new Date("2021-07-17 20:28:11"),"cuserid","UpT2","cusername","y2y7","linkStatus","p"); + XmIterationProductLink xmIterationProductLink=BaseUtils.fromMap(p,XmIterationProductLink.class); + xmIterationProductLinkService.insert(xmIterationProductLink); + //Assert.assertEquals(1, result); + } + +} diff --git a/xm-core/src/test/java/com/xm/core/service/TestXmProductProjectLinkService.java b/xm-core/src/test/java/com/xm/core/service/TestXmProductProjectLinkService.java new file mode 100644 index 00000000..772c5432 --- /dev/null +++ b/xm-core/src/test/java/com/xm/core/service/TestXmProductProjectLinkService.java @@ -0,0 +1,53 @@ +package com.xm.core.service; + +import java.util.*; +import java.text.SimpleDateFormat; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.ContextHierarchy; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import com.mdp.core.utils.BaseUtils; +import org.springframework.beans.factory.annotation.Autowired; +import com.xm.core.service.XmProductProjectLinkService; +import com.mdp.mybatis.PageUtils; +import com.github.pagehelper.Page; +import com.xm.core.entity.XmProductProjectLink; +import org.springframework.boot.test.context.SpringBootTest; +/** + * XmProductProjectLinkService的测试案例 + * 组织 com
+ * 顶级模块 xm
+ * 大模块 core
+ * 小模块
+ * 表 XM.xm_product_project_link 产品与项目的关联关系表,一般由产品经理挂接项目到产品上
+ * 实体 XmProductProjectLink
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * projectId,productId,ctime,cuserid,cusername,linkStatus;
+ * 当前表的所有字段名:
+ * project_id,product_id,ctime,cuserid,cusername,link_status;
+ * 当前主键(包括多主键):
+ * project_id;
+ ***/ + +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest +public class TestXmProductProjectLinkService { + + @Autowired + XmProductProjectLinkService xmProductProjectLinkService; + + /** + * 新增一条数据 + ***/ + @Test + public void insert() { + Map p=BaseUtils.map("projectId","b1g5","productId","V9Uu","ctime",new Date("2021-07-17 20:28:11"),"cuserid","uw3F","cusername","sPev","linkStatus","1"); + XmProductProjectLink xmProductProjectLink=BaseUtils.fromMap(p,XmProductProjectLink.class); + xmProductProjectLinkService.insert(xmProductProjectLink); + //Assert.assertEquals(1, result); + } + +}