diff --git a/xm-core/src/main/java/com/xm/share/ctrl/ShareBizInfoController.java b/xm-core/src/main/java/com/xm/share/ctrl/ShareBizInfoController.java new file mode 100644 index 00000000..816b221c --- /dev/null +++ b/xm-core/src/main/java/com/xm/share/ctrl/ShareBizInfoController.java @@ -0,0 +1,202 @@ +package com.xm.share.ctrl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.xm.share.service.ShareReceInfoService; +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.share.service.ShareBizInfoService; +import com.xm.share.entity.ShareBizInfo; +/** + * url编制采用rest风格,如对XM.xm_share_biz_info 分享行为记录表的操作有增删改查,对应的url分别为:
+ * 新增: share/shareBizInfo/add
+ * 查询: share/shareBizInfo/list
+ * 模糊查询: share/shareBizInfo/listKey
+ * 修改: share/shareBizInfo/edit
+ * 删除: share/shareBizInfo/del
+ * 批量删除: share/shareBizInfo/batchDel
+ * 组织 com 顶级模块 xm 大模块 share 小模块
+ * 实体 ShareBizInfo 表 XM.xm_share_biz_info 当前主键(包括多主键): share_key; + ***/ +@RestController("xm.share.shareBizInfoController") +@RequestMapping(value="/**/share/shareBizInfo") +@Api(tags={"分享行为记录表操作接口"}) +public class ShareBizInfoController { + + static Logger logger =LoggerFactory.getLogger(ShareBizInfoController.class); + + @Autowired + private ShareBizInfoService shareBizInfoService; + + @Autowired + private ShareReceInfoService shareReceInfoService; + + + @ApiOperation( value = "查询分享行为记录表信息列表",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200,response=ShareBizInfo.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}") + }) + @RequestMapping(value="/list",method=RequestMethod.GET) + public Map listShareBizInfo( @RequestParam Map shareBizInfo){ + Map m = new HashMap<>(); + RequestUtils.transformArray(shareBizInfo, "shareKeys"); + PageUtils.startPage(shareBizInfo); + List> shareBizInfoList = shareBizInfoService.selectListMapByWhere(shareBizInfo); //列出ShareBizInfo列表 + PageUtils.responePage(m, shareBizInfoList); + m.put("data",shareBizInfoList); + Tips tips=new Tips("查询成功"); + m.put("tips", tips); + return m; + } + + + + /***/ + @ApiOperation( value = "新增一条分享行为记录表信息",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200,response=ShareBizInfo.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") + }) + @RequestMapping(value="/add",method=RequestMethod.POST) + public Map addShareBizInfo(@RequestBody ShareBizInfo shareBizInfo) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功新增一条数据"); + try{ + shareBizInfo.setShareKey(shareBizInfoService.createKey("shareKey")); + //todo 检查是否已经分享过 通过biz_pk_id+share_userid进行判断 + ShareBizInfo queryBizInfo=new ShareBizInfo(); + queryBizInfo.setBizPkId(shareBizInfo.getBizPkId()); + queryBizInfo.setBizType(shareBizInfo.getBizType()); + queryBizInfo.setBizSubPkId(shareBizInfo.getBizSubPkId()); + queryBizInfo.setShareUserid(shareBizInfo.getShareUserid()); + List myShareBizInfos=shareBizInfoService.selectListByWhere(queryBizInfo); + if(myShareBizInfos!=null && myShareBizInfos.size()>0){ + tips.setOkMsg("分享成功"); + m.put("tips", tips); + m.put("data",myShareBizInfos.get(0)); + return m; + } + //todo 检查我是否接受的别人的分享的第二次分享 通过biz_pk_id+share_userid判断 + ShareBizInfo queryBizInfo2=new ShareBizInfo(); + queryBizInfo2.setBizPkId(shareBizInfo.getBizPkId()); + queryBizInfo2.setBizType(shareBizInfo.getBizType()); + queryBizInfo2.setBizSubPkId(shareBizInfo.getBizSubPkId()); + queryBizInfo2.setShareUserid(shareBizInfo.getShareUserid()); + List myParentShareBizInfos=shareBizInfoService.selectList("selectMyParentShareBizInfo",queryBizInfo2); + if(myParentShareBizInfos!=null && myParentShareBizInfos.size()>0){ + ShareBizInfo myParentShareBizInfoDb=myParentShareBizInfos.get(0); + shareBizInfo.setPshareKey(myParentShareBizInfoDb.getShareKey()); + shareBizInfo.setPshareUserid(myParentShareBizInfoDb.getShareUserid()); + shareBizInfo.setPshareUsername(myParentShareBizInfoDb.getShareUsername()); + } + shareBizInfoService.insert(shareBizInfo); + m.put("data",shareBizInfo); + }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 delShareBizInfo(@RequestBody ShareBizInfo shareBizInfo){ + Map m = new HashMap<>(); + Tips tips=new Tips("成功删除一条数据"); + try{ + shareBizInfoService.deleteByPk(shareBizInfo); + }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=ShareBizInfo.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") + }) + @RequestMapping(value="/edit",method=RequestMethod.POST) + public Map editShareBizInfo(@RequestBody ShareBizInfo shareBizInfo) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功更新一条数据"); + try{ + shareBizInfoService.updateByPk(shareBizInfo); + m.put("data",shareBizInfo); + }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 batchDelShareBizInfo(@RequestBody List shareBizInfos) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功删除"+shareBizInfos.size()+"条数据"); + try{ + shareBizInfoService.batchDelete(shareBizInfos); + }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/share/ctrl/ShareReceInfoController.java b/xm-core/src/main/java/com/xm/share/ctrl/ShareReceInfoController.java new file mode 100644 index 00000000..1d69a84b --- /dev/null +++ b/xm-core/src/main/java/com/xm/share/ctrl/ShareReceInfoController.java @@ -0,0 +1,181 @@ +package com.xm.share.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.share.service.ShareReceInfoService; +import com.xm.share.entity.ShareReceInfo; +/** + * url编制采用rest风格,如对XM.xm_share_rece_info 分享后接收人行为记录表的操作有增删改查,对应的url分别为:
+ * 新增: share/shareReceInfo/add
+ * 查询: share/shareReceInfo/list
+ * 模糊查询: share/shareReceInfo/listKey
+ * 修改: share/shareReceInfo/edit
+ * 删除: share/shareReceInfo/del
+ * 批量删除: share/shareReceInfo/batchDel
+ * 组织 com 顶级模块 xm 大模块 share 小模块
+ * 实体 ShareReceInfo 表 XM.xm_share_rece_info 当前主键(包括多主键): id; + ***/ +@RestController("xm.share.shareReceInfoController") +@RequestMapping(value="/**/share/shareReceInfo") +@Api(tags={"分享后接收人行为记录表操作接口"}) +public class ShareReceInfoController { + + static Logger logger =LoggerFactory.getLogger(ShareReceInfoController.class); + + @Autowired + private ShareReceInfoService shareReceInfoService; + + + + + @ApiOperation( value = "查询分享后接收人行为记录表信息列表",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200,response=ShareReceInfo.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}") + }) + @RequestMapping(value="/list",method=RequestMethod.GET) + public Map listShareReceInfo( @RequestParam Map shareReceInfo){ + Map m = new HashMap<>(); + RequestUtils.transformArray(shareReceInfo, "ids"); + PageUtils.startPage(shareReceInfo); + List> shareReceInfoList = shareReceInfoService.selectListMapByWhere(shareReceInfo); //列出ShareReceInfo列表 + PageUtils.responePage(m, shareReceInfoList); + m.put("data",shareReceInfoList); + Tips tips=new Tips("查询成功"); + m.put("tips", tips); + return m; + } + + + + /** + */ + @ApiOperation( value = "新增一条分享后接收人行为记录表信息",notes=" ") + @ApiResponses({ + @ApiResponse(code = 200,response=ShareReceInfo.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") + }) + @RequestMapping(value="/add",method=RequestMethod.POST) + public Map addShareReceInfo(@RequestBody ShareReceInfo shareReceInfo) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功新增一条数据"); + try{ + shareReceInfo.setId(shareReceInfoService.createKey("id")); + ShareReceInfo query=new ShareReceInfo(); + query.setShareKey(shareReceInfo.getShareKey()); + query.setReceiverId(shareReceInfo.getReceiverId()); + List myShareReceInfos=this.shareReceInfoService.selectListByWhere(query); + if(myShareReceInfos!=null && myShareReceInfos.size()>0){ + tips.setOkMsg("成功"); + m.put("tips", tips); + } + shareReceInfoService.insert(shareReceInfo); + m.put("data",shareReceInfo); + }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 delShareReceInfo(@RequestBody ShareReceInfo shareReceInfo){ + Map m = new HashMap<>(); + Tips tips=new Tips("成功删除一条数据"); + try{ + shareReceInfoService.deleteByPk(shareReceInfo); + }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=ShareReceInfo.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") + }) + @RequestMapping(value="/edit",method=RequestMethod.POST) + public Map editShareReceInfo(@RequestBody ShareReceInfo shareReceInfo) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功更新一条数据"); + try{ + shareReceInfoService.updateByPk(shareReceInfo); + m.put("data",shareReceInfo); + }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 batchDelShareReceInfo(@RequestBody List shareReceInfos) { + Map m = new HashMap<>(); + Tips tips=new Tips("成功删除"+shareReceInfos.size()+"条数据"); + try{ + shareReceInfoService.batchDelete(shareReceInfos); + }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/share/entity/ShareBizInfo.java b/xm-core/src/main/java/com/xm/share/entity/ShareBizInfo.java new file mode 100644 index 00000000..0e0640ec --- /dev/null +++ b/xm-core/src/main/java/com/xm/share/entity/ShareBizInfo.java @@ -0,0 +1,288 @@ +package com.xm.share.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; + +/** + * 组织 com 顶级模块 xm 大模块 share 小模块
+ * 实体 ShareBizInfo所有属性名:
+ * shareKey,shareUserid,shareUsername,pageUrl,pageType,shareTime,bizPkId,bizBranchId,shareBranchId,bizSubPkId,params,shareType,pshareKey,pshareUserid,pshareUsername,bizType,bizCategoryId;
+ * 表 XM.xm_share_biz_info 分享行为记录表的所有字段名:
+ * share_key,share_userid,share_username,page_url,page_type,share_time,biz_pk_id,biz_branch_id,share_branch_id,biz_sub_pk_id,params,share_type,pshare_key,pshare_userid,pshare_username,biz_type,biz_category_id;
+ * 当前主键(包括多主键):
+ * share_key;
+ */ +@ApiModel(description="分享行为记录表") +public class ShareBizInfo implements java.io.Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(notes="分享编号,一次分享行为一个shareKey,分享链接之间前端传递;,主键",allowEmptyValue=true,example="",allowableValues="") + String shareKey; + + + @ApiModelProperty(notes="分享人编号",allowEmptyValue=true,example="",allowableValues="") + String shareUserid; + + @ApiModelProperty(notes="分享人姓名",allowEmptyValue=true,example="",allowableValues="") + String shareUsername; + + @ApiModelProperty(notes="分享地址",allowEmptyValue=true,example="",allowableValues="") + String pageUrl; + + @ApiModelProperty(notes="分享地址类型0-h5,1-微信小程序,2-微信公众号,3-app页面",allowEmptyValue=true,example="",allowableValues="") + String pageType; + + @ApiModelProperty(notes="分享时间",allowEmptyValue=true,example="",allowableValues="") + Date shareTime; + + @ApiModelProperty(notes="分享的业务对应的主键",allowEmptyValue=true,example="",allowableValues="") + String bizPkId; + + @ApiModelProperty(notes="分享的业务所属机构号",allowEmptyValue=true,example="",allowableValues="") + String bizBranchId; + + @ApiModelProperty(notes="分享人所属机构号",allowEmptyValue=true,example="",allowableValues="") + String shareBranchId; + + @ApiModelProperty(notes="分享的业务对应的子主键(复合主键下使用)",allowEmptyValue=true,example="",allowableValues="") + String bizSubPkId; + + @ApiModelProperty(notes="分享参数,需要特殊扩展时使用",allowEmptyValue=true,example="",allowableValues="") + String params; + + @ApiModelProperty(notes="分享业务类型",allowEmptyValue=true,example="",allowableValues="") + String shareType; + + @ApiModelProperty(notes="上级分享码,冗余字段,方便计算",allowEmptyValue=true,example="",allowableValues="") + String pshareKey; + + @ApiModelProperty(notes="上级分享人编号,冗余字段,方便计算",allowEmptyValue=true,example="",allowableValues="") + String pshareUserid; + + @ApiModelProperty(notes="上级分享人姓名,冗余字段,方便计算",allowEmptyValue=true,example="",allowableValues="") + String pshareUsername; + + @ApiModelProperty(notes="业务分类0商品1项目2任务3故事4app",allowEmptyValue=true,example="",allowableValues="") + String bizType; + + @ApiModelProperty(notes="业务分类的主键,用于与分佣方案比对,分佣方案是可以针对一类商品进行分佣,可以对于具体的商品进行分佣",allowEmptyValue=true,example="",allowableValues="") + String bizCategoryId; + + /**分享编号,一次分享行为一个shareKey,分享链接之间前端传递;**/ + public ShareBizInfo(String shareKey) { + this.shareKey = shareKey; + } + + /**分享行为记录表**/ + public ShareBizInfo() { + } + + /** + * 分享编号,一次分享行为一个shareKey,分享链接之间前端传递; + **/ + public void setShareKey(String shareKey) { + this.shareKey = shareKey; + } + /** + * 分享人编号 + **/ + public void setShareUserid(String shareUserid) { + this.shareUserid = shareUserid; + } + /** + * 分享人姓名 + **/ + public void setShareUsername(String shareUsername) { + this.shareUsername = shareUsername; + } + /** + * 分享地址 + **/ + public void setPageUrl(String pageUrl) { + this.pageUrl = pageUrl; + } + /** + * 分享地址类型0-h5,1-微信小程序,2-微信公众号,3-app页面 + **/ + public void setPageType(String pageType) { + this.pageType = pageType; + } + /** + * 分享时间 + **/ + public void setShareTime(Date shareTime) { + this.shareTime = shareTime; + } + /** + * 分享的业务对应的主键 + **/ + public void setBizPkId(String bizPkId) { + this.bizPkId = bizPkId; + } + /** + * 分享的业务所属机构号 + **/ + public void setBizBranchId(String bizBranchId) { + this.bizBranchId = bizBranchId; + } + /** + * 分享人所属机构号 + **/ + public void setShareBranchId(String shareBranchId) { + this.shareBranchId = shareBranchId; + } + /** + * 分享的业务对应的子主键(复合主键下使用) + **/ + public void setBizSubPkId(String bizSubPkId) { + this.bizSubPkId = bizSubPkId; + } + /** + * 分享参数,需要特殊扩展时使用 + **/ + public void setParams(String params) { + this.params = params; + } + /** + * 分享业务类型 + **/ + public void setShareType(String shareType) { + this.shareType = shareType; + } + /** + * 上级分享码,冗余字段,方便计算 + **/ + public void setPshareKey(String pshareKey) { + this.pshareKey = pshareKey; + } + /** + * 上级分享人编号,冗余字段,方便计算 + **/ + public void setPshareUserid(String pshareUserid) { + this.pshareUserid = pshareUserid; + } + /** + * 上级分享人姓名,冗余字段,方便计算 + **/ + public void setPshareUsername(String pshareUsername) { + this.pshareUsername = pshareUsername; + } + /** + * 业务分类0商品1项目2任务3故事4app + **/ + public void setBizType(String bizType) { + this.bizType = bizType; + } + /** + * 业务分类的主键,用于与分佣方案比对,分佣方案是可以针对一类商品进行分佣,可以对于具体的商品进行分佣 + **/ + public void setBizCategoryId(String bizCategoryId) { + this.bizCategoryId = bizCategoryId; + } + + /** + * 分享编号,一次分享行为一个shareKey,分享链接之间前端传递; + **/ + public String getShareKey() { + return this.shareKey; + } + /** + * 分享人编号 + **/ + public String getShareUserid() { + return this.shareUserid; + } + /** + * 分享人姓名 + **/ + public String getShareUsername() { + return this.shareUsername; + } + /** + * 分享地址 + **/ + public String getPageUrl() { + return this.pageUrl; + } + /** + * 分享地址类型0-h5,1-微信小程序,2-微信公众号,3-app页面 + **/ + public String getPageType() { + return this.pageType; + } + /** + * 分享时间 + **/ + public Date getShareTime() { + return this.shareTime; + } + /** + * 分享的业务对应的主键 + **/ + public String getBizPkId() { + return this.bizPkId; + } + /** + * 分享的业务所属机构号 + **/ + public String getBizBranchId() { + return this.bizBranchId; + } + /** + * 分享人所属机构号 + **/ + public String getShareBranchId() { + return this.shareBranchId; + } + /** + * 分享的业务对应的子主键(复合主键下使用) + **/ + public String getBizSubPkId() { + return this.bizSubPkId; + } + /** + * 分享参数,需要特殊扩展时使用 + **/ + public String getParams() { + return this.params; + } + /** + * 分享业务类型 + **/ + public String getShareType() { + return this.shareType; + } + /** + * 上级分享码,冗余字段,方便计算 + **/ + public String getPshareKey() { + return this.pshareKey; + } + /** + * 上级分享人编号,冗余字段,方便计算 + **/ + public String getPshareUserid() { + return this.pshareUserid; + } + /** + * 上级分享人姓名,冗余字段,方便计算 + **/ + public String getPshareUsername() { + return this.pshareUsername; + } + /** + * 业务分类0商品1项目2任务3故事4app + **/ + public String getBizType() { + return this.bizType; + } + /** + * 业务分类的主键,用于与分佣方案比对,分佣方案是可以针对一类商品进行分佣,可以对于具体的商品进行分佣 + **/ + public String getBizCategoryId() { + return this.bizCategoryId; + } + +} \ No newline at end of file diff --git a/xm-core/src/main/java/com/xm/share/entity/ShareReceInfo.java b/xm-core/src/main/java/com/xm/share/entity/ShareReceInfo.java new file mode 100644 index 00000000..a4bc876d --- /dev/null +++ b/xm-core/src/main/java/com/xm/share/entity/ShareReceInfo.java @@ -0,0 +1,108 @@ +package com.xm.share.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; + +/** + * 组织 com 顶级模块 xm 大模块 share 小模块
+ * 实体 ShareReceInfo所有属性名:
+ * id,shareKey,receiverId,receiverName,receTime;
+ * 表 XM.xm_share_rece_info 分享后接收人行为记录表的所有字段名:
+ * id,share_key,receiver_id,receiver_name,rece_time;
+ * 当前主键(包括多主键):
+ * id;
+ */ +@ApiModel(description="分享后接收人行为记录表") +public class ShareReceInfo 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 shareKey; + + @ApiModelProperty(notes="接收人编号",allowEmptyValue=true,example="",allowableValues="") + String receiverId; + + @ApiModelProperty(notes="接收入姓名",allowEmptyValue=true,example="",allowableValues="") + String receiverName; + + @ApiModelProperty(notes="接收时间",allowEmptyValue=true,example="",allowableValues="") + Date receTime; + + /**主键**/ + public ShareReceInfo(String id) { + this.id = id; + } + + /**分享后接收人行为记录表**/ + public ShareReceInfo() { + } + + /** + * 主键 + **/ + public void setId(String id) { + this.id = id; + } + /** + * 分享编号,分享链接之间前端传递 + **/ + public void setShareKey(String shareKey) { + this.shareKey = shareKey; + } + /** + * 接收人编号 + **/ + public void setReceiverId(String receiverId) { + this.receiverId = receiverId; + } + /** + * 接收入姓名 + **/ + public void setReceiverName(String receiverName) { + this.receiverName = receiverName; + } + /** + * 接收时间 + **/ + public void setReceTime(Date receTime) { + this.receTime = receTime; + } + + /** + * 主键 + **/ + public String getId() { + return this.id; + } + /** + * 分享编号,分享链接之间前端传递 + **/ + public String getShareKey() { + return this.shareKey; + } + /** + * 接收人编号 + **/ + public String getReceiverId() { + return this.receiverId; + } + /** + * 接收入姓名 + **/ + public String getReceiverName() { + return this.receiverName; + } + /** + * 接收时间 + **/ + public Date getReceTime() { + return this.receTime; + } + +} \ No newline at end of file diff --git a/xm-core/src/main/java/com/xm/share/service/ShareBizInfoService.java b/xm-core/src/main/java/com/xm/share/service/ShareBizInfoService.java new file mode 100644 index 00000000..813b6a25 --- /dev/null +++ b/xm-core/src/main/java/com/xm/share/service/ShareBizInfoService.java @@ -0,0 +1,21 @@ +package com.xm.share.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.share.entity.ShareBizInfo; +/** + * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.
+ * 组织 com 顶级模块 xm 大模块 share 小模块
+ * 实体 ShareBizInfo 表 XM.xm_share_biz_info 当前主键(包括多主键): share_key; + ***/ +@Service("xm.share.shareBizInfoService") +public class ShareBizInfoService extends BaseService { + static Logger logger =LoggerFactory.getLogger(ShareBizInfoService.class); + /** 请在此类添加自定义函数 */ + +} + diff --git a/xm-core/src/main/java/com/xm/share/service/ShareReceInfoService.java b/xm-core/src/main/java/com/xm/share/service/ShareReceInfoService.java new file mode 100644 index 00000000..536752eb --- /dev/null +++ b/xm-core/src/main/java/com/xm/share/service/ShareReceInfoService.java @@ -0,0 +1,21 @@ +package com.xm.share.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.share.entity.ShareReceInfo; +/** + * 父类已经支持增删改查操作,因此,即使本类什么也不写,也已经可以满足一般的增删改查操作了.
+ * 组织 com 顶级模块 xm 大模块 share 小模块
+ * 实体 ShareReceInfo 表 XM.xm_share_rece_info 当前主键(包括多主键): id; + ***/ +@Service("xm.share.shareReceInfoService") +public class ShareReceInfoService extends BaseService { + static Logger logger =LoggerFactory.getLogger(ShareReceInfoService.class); + /** 请在此类添加自定义函数 */ + +} + diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/share/dao/ShareBizInfoMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/share/dao/ShareBizInfoMapper.xml new file mode 100644 index 00000000..e52f8e6b --- /dev/null +++ b/xm-core/src/main/resources/mybatis/mapper/xm/share/dao/ShareBizInfoMapper.xml @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into XM.xm_share_biz_info( + + ) values ( + #{shareKey},#{shareUserid},#{shareUsername},#{pageUrl},#{pageType},#{shareTime},#{bizPkId},#{bizBranchId},#{shareBranchId},#{bizSubPkId},#{params},#{shareType},#{pshareKey},#{pshareUserid},#{pshareUsername},#{bizType},#{bizCategoryId} + ) + + + + + delete from XM.xm_share_biz_info + + 1=2 + + + + + + delete from XM.xm_share_biz_info + where share_key = #{shareKey} + + + + + update XM.xm_share_biz_info + + + + where share_key = #{shareKey} + + + + + update XM.xm_share_biz_info + + + + where share_key = #{shareKey} + + + + + + + + update XM.xm_share_biz_info + set + + where share_key = #{item.shareKey} + + + + + delete from XM.xm_share_biz_info + where + (share_key) + in + + ( #{item.shareKey} + ) + + + + + + + share_key,share_userid,share_username,page_url,page_type,share_time,biz_pk_id,biz_branch_id,share_branch_id,biz_sub_pk_id,params,share_type,pshare_key,pshare_userid,pshare_username,biz_type,biz_category_id + + + + + and res.share_key = #{shareKey} + and res.share_userid = #{shareUserid} + and res.share_username = #{shareUsername} + and res.page_url = #{pageUrl} + and res.page_type = #{pageType} + and date_format(res.share_time,'%Y-%m-%d') = date_format(#{shareTime},'%Y-%m-%d') + and res.biz_pk_id = #{bizPkId} + and res.biz_branch_id = #{bizBranchId} + and res.share_branch_id = #{shareBranchId} + and res.biz_sub_pk_id = #{bizSubPkId} + and res.params = #{params} + and res.share_type = #{shareType} + and res.pshare_key = #{pshareKey} + and res.pshare_userid = #{pshareUserid} + and res.pshare_username = #{pshareUsername} + and res.biz_type = #{bizType} + and res.biz_category_id = #{bizCategoryId} + + + + share_userid = #{shareUserid}, + share_username = #{shareUsername}, + page_url = #{pageUrl}, + page_type = #{pageType}, + share_time = #{shareTime}, + biz_pk_id = #{bizPkId}, + biz_branch_id = #{bizBranchId}, + share_branch_id = #{shareBranchId}, + biz_sub_pk_id = #{bizSubPkId}, + params = #{params}, + share_type = #{shareType}, + pshare_key = #{pshareKey}, + pshare_userid = #{pshareUserid}, + pshare_username = #{pshareUsername}, + biz_type = #{bizType}, + biz_category_id = #{bizCategoryId} + + + share_userid = #{shareUserid}, + share_username = #{shareUsername}, + page_url = #{pageUrl}, + page_type = #{pageType}, + share_time = #{shareTime}, + biz_pk_id = #{bizPkId}, + biz_branch_id = #{bizBranchId}, + share_branch_id = #{shareBranchId}, + biz_sub_pk_id = #{bizSubPkId}, + params = #{params}, + share_type = #{shareType}, + pshare_key = #{pshareKey}, + pshare_userid = #{pshareUserid}, + pshare_username = #{pshareUsername}, + biz_type = #{bizType}, + biz_category_id = #{bizCategoryId}, + + + + share_userid = #{item.shareUserid}, + share_username = #{item.shareUsername}, + page_url = #{item.pageUrl}, + page_type = #{item.pageType}, + share_time = #{item.shareTime}, + biz_pk_id = #{item.bizPkId}, + biz_branch_id = #{item.bizBranchId}, + share_branch_id = #{item.shareBranchId}, + biz_sub_pk_id = #{item.bizSubPkId}, + params = #{item.params}, + share_type = #{item.shareType}, + pshare_key = #{item.pshareKey}, + pshare_userid = #{item.pshareUserid}, + pshare_username = #{item.pshareUsername}, + biz_type = #{item.bizType}, + biz_category_id = #{item.bizCategoryId} + + \ No newline at end of file diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/share/dao/ShareReceInfoMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/share/dao/ShareReceInfoMapper.xml new file mode 100644 index 00000000..f8614599 --- /dev/null +++ b/xm-core/src/main/resources/mybatis/mapper/xm/share/dao/ShareReceInfoMapper.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into XM.xm_share_rece_info( + + ) values ( + #{id},#{shareKey},#{receiverId},#{receiverName},#{receTime} + ) + + + + + delete from XM.xm_share_rece_info + + 1=2 + + + + + + delete from XM.xm_share_rece_info + where id = #{id} + + + + + update XM.xm_share_rece_info + + + + where id = #{id} + + + + + update XM.xm_share_rece_info + + + + where id = #{id} + + + + + + + + update XM.xm_share_rece_info + set + + where id = #{item.id} + + + + + delete from XM.xm_share_rece_info + where + (id) + in + + ( #{item.id} + ) + + + + + + + id,share_key,receiver_id,receiver_name,rece_time + + + + + and res.id = #{id} + and res.share_key = #{shareKey} + and res.receiver_id = #{receiverId} + and res.receiver_name = #{receiverName} + and date_format(res.rece_time,'%Y-%m-%d') = date_format(#{receTime},'%Y-%m-%d') + + + + share_key = #{shareKey}, + receiver_id = #{receiverId}, + receiver_name = #{receiverName}, + rece_time = #{receTime} + + + share_key = #{shareKey}, + receiver_id = #{receiverId}, + receiver_name = #{receiverName}, + rece_time = #{receTime}, + + + + share_key = #{item.shareKey}, + receiver_id = #{item.receiverId}, + receiver_name = #{item.receiverName}, + rece_time = #{item.receTime} + + \ No newline at end of file diff --git a/xm-core/src/test/java/com/xm/share/ctrl/TestShareBizInfoController.java b/xm-core/src/test/java/com/xm/share/ctrl/TestShareBizInfoController.java new file mode 100644 index 00000000..69fbff9a --- /dev/null +++ b/xm-core/src/test/java/com/xm/share/ctrl/TestShareBizInfoController.java @@ -0,0 +1,127 @@ +package com.xm.share.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.share.entity.ShareBizInfo; +import com.mdp.core.utils.BaseUtils; +/** + * 组织 com
+ * 顶级模块 xm
+ * 大模块 share
+ * 小模块
+ * 表 XM.xm_share_biz_info 分享行为记录表
+ * 实体 ShareBizInfo
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * shareKey,shareUserid,shareUsername,pageUrl,pageType,shareTime,bizPkId,bizBranchId,shareBranchId,bizSubPkId,params,shareType,pshareKey,pshareUserid,pshareUsername,bizType,bizCategoryId;
+ * 当前表的所有字段名:
+ * share_key,share_userid,share_username,page_url,page_type,share_time,biz_pk_id,biz_branch_id,share_branch_id,biz_sub_pk_id,params,share_type,pshare_key,pshare_userid,pshare_username,biz_type,biz_category_id;
+ * 当前主键(包括多主键):
+ * share_key;
+ **/ +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest +public class TestShareBizInfoController { + + @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("shareKey","9303","shareUserid","zZoc","shareUsername","V9tr","pageUrl","wBF3","pageType","ylHj","shareTime",new Date("2021-04-22 17:12:53"),"bizPkId","c6DC","bizBranchId","5HjB","shareBranchId","0aSc","bizSubPkId","5ps3","params","b175","shareType","q0Jh","pshareKey","it9W","pshareUserid","IaYJ","pshareUsername","GGIz","bizType","9Uqr","bizCategoryId","FL8C"); + ShareBizInfo shareBizInfo=BaseUtils.fromMap(p,ShareBizInfo.class); + String jsonShareBizInfo=om.writeValueAsString(shareBizInfo); + mockMvc.perform( post("/**/share/shareBizInfo/add").content(jsonShareBizInfo).contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + + @Test + public void list() throws Exception { + mockMvc.perform( get("/**/share/shareBizInfo/list") + .param("shareKey","9303").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("shareKey","9303","shareUserid","zZoc","shareUsername","V9tr","pageUrl","wBF3","pageType","ylHj","shareTime",new Date("2021-04-22 17:12:53"),"bizPkId","c6DC","bizBranchId","5HjB","shareBranchId","0aSc","bizSubPkId","5ps3","params","b175","shareType","q0Jh","pshareKey","it9W","pshareUserid","IaYJ","pshareUsername","GGIz","bizType","9Uqr","bizCategoryId","FL8C"); + ShareBizInfo shareBizInfo=BaseUtils.fromMap(p,ShareBizInfo.class); + String jsonShareBizInfo=om.writeValueAsString(shareBizInfo); + mockMvc.perform( post("/**/share/shareBizInfo/edit").content(jsonShareBizInfo).contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + + @Test + public void del() throws Exception { + mockMvc.perform( post("/**/share/shareBizInfo/del").content("9303").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("shareKey","9303","shareUserid","zZoc","shareUsername","V9tr","pageUrl","wBF3","pageType","ylHj","shareTime",new Date("2021-04-22 17:12:53"),"bizPkId","c6DC","bizBranchId","5HjB","shareBranchId","0aSc","bizSubPkId","5ps3","params","b175","shareType","q0Jh","pshareKey","it9W","pshareUserid","IaYJ","pshareUsername","GGIz","bizType","9Uqr","bizCategoryId","FL8C"); + ShareBizInfo shareBizInfo=BaseUtils.fromMap(p,ShareBizInfo.class); + List shareBizInfos=new ArrayList<>(); + shareBizInfos.add(shareBizInfo); + String jsonShareBizInfo=om.writeValueAsString(shareBizInfos); + mockMvc.perform( post("/**/share/shareBizInfo/batchDel").content(jsonShareBizInfo).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/share/ctrl/TestShareReceInfoController.java b/xm-core/src/test/java/com/xm/share/ctrl/TestShareReceInfoController.java new file mode 100644 index 00000000..76809f7e --- /dev/null +++ b/xm-core/src/test/java/com/xm/share/ctrl/TestShareReceInfoController.java @@ -0,0 +1,127 @@ +package com.xm.share.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.share.entity.ShareReceInfo; +import com.mdp.core.utils.BaseUtils; +/** + * 组织 com
+ * 顶级模块 xm
+ * 大模块 share
+ * 小模块
+ * 表 XM.xm_share_rece_info 分享后接收人行为记录表
+ * 实体 ShareReceInfo
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * id,shareKey,receiverId,receiverName,receTime;
+ * 当前表的所有字段名:
+ * id,share_key,receiver_id,receiver_name,rece_time;
+ * 当前主键(包括多主键):
+ * id;
+ **/ +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest +public class TestShareReceInfoController { + + @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("id","1zr2","shareKey","dp61","receiverId","9s6n","receiverName","83i7","receTime",new Date("2021-04-22 17:12:53")); + ShareReceInfo shareReceInfo=BaseUtils.fromMap(p,ShareReceInfo.class); + String jsonShareReceInfo=om.writeValueAsString(shareReceInfo); + mockMvc.perform( post("/**/share/shareReceInfo/add").content(jsonShareReceInfo).contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + + @Test + public void list() throws Exception { + mockMvc.perform( get("/**/share/shareReceInfo/list") + .param("id","1zr2").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("id","1zr2","shareKey","dp61","receiverId","9s6n","receiverName","83i7","receTime",new Date("2021-04-22 17:12:53")); + ShareReceInfo shareReceInfo=BaseUtils.fromMap(p,ShareReceInfo.class); + String jsonShareReceInfo=om.writeValueAsString(shareReceInfo); + mockMvc.perform( post("/**/share/shareReceInfo/edit").content(jsonShareReceInfo).contentType(MediaType.APPLICATION_JSON)) + .andDo(print()) + .andExpect(status().isOk()) + .andExpect(jsonPath("tips.isOk").value(true)); + } + + @Test + public void del() throws Exception { + mockMvc.perform( post("/**/share/shareReceInfo/del").content("1zr2").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("id","1zr2","shareKey","dp61","receiverId","9s6n","receiverName","83i7","receTime",new Date("2021-04-22 17:12:53")); + ShareReceInfo shareReceInfo=BaseUtils.fromMap(p,ShareReceInfo.class); + List shareReceInfos=new ArrayList<>(); + shareReceInfos.add(shareReceInfo); + String jsonShareReceInfo=om.writeValueAsString(shareReceInfos); + mockMvc.perform( post("/**/share/shareReceInfo/batchDel").content(jsonShareReceInfo).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/share/dao/TestShareBizInfoDao.java b/xm-core/src/test/java/com/xm/share/dao/TestShareBizInfoDao.java new file mode 100644 index 00000000..1fd8206c --- /dev/null +++ b/xm-core/src/test/java/com/xm/share/dao/TestShareBizInfoDao.java @@ -0,0 +1,51 @@ +package com.xm.share.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.share.entity.ShareBizInfo; +import org.springframework.boot.test.context.SpringBootTest; +/** + * ShareBizInfoDao的测试案例 + * 组织 com
+ * 顶级模块 xm
+ * 大模块 share
+ * 小模块
+ * 表 XM.xm_share_biz_info 分享行为记录表
+ * 实体 ShareBizInfo
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * shareKey,shareUserid,shareUsername,pageUrl,pageType,shareTime,bizPkId,bizBranchId,shareBranchId,bizSubPkId,params,shareType,pshareKey,pshareUserid,pshareUsername,bizType,bizCategoryId;
+ * 当前表的所有字段名:
+ * share_key,share_userid,share_username,page_url,page_type,share_time,biz_pk_id,biz_branch_id,share_branch_id,biz_sub_pk_id,params,share_type,pshare_key,pshare_userid,pshare_username,biz_type,biz_category_id;
+ * 当前主键(包括多主键):
+ * share_key;
+ ***/ + @RunWith(SpringJUnit4ClassRunner.class) + @SpringBootTest +public class TestShareBizInfoDao { + + @Autowired + BaseDao baseDao; + + /** + * 新增一条数据 + ***/ + @Test + public void insert() { + Map p=BaseUtils.map("shareKey","9303","shareUserid","zZoc","shareUsername","V9tr","pageUrl","wBF3","pageType","ylHj","shareTime",new Date("2021-04-22 17:12:53"),"bizPkId","c6DC","bizBranchId","5HjB","shareBranchId","0aSc","bizSubPkId","5ps3","params","b175","shareType","q0Jh","pshareKey","it9W","pshareUserid","IaYJ","pshareUsername","GGIz","bizType","9Uqr","bizCategoryId","FL8C"); + ShareBizInfo shareBizInfo=BaseUtils.fromMap(p,ShareBizInfo.class); + baseDao.insert(shareBizInfo); + //Assert.assertEquals(1, result); + } +} diff --git a/xm-core/src/test/java/com/xm/share/dao/TestShareReceInfoDao.java b/xm-core/src/test/java/com/xm/share/dao/TestShareReceInfoDao.java new file mode 100644 index 00000000..1c1b6e8e --- /dev/null +++ b/xm-core/src/test/java/com/xm/share/dao/TestShareReceInfoDao.java @@ -0,0 +1,51 @@ +package com.xm.share.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.share.entity.ShareReceInfo; +import org.springframework.boot.test.context.SpringBootTest; +/** + * ShareReceInfoDao的测试案例 + * 组织 com
+ * 顶级模块 xm
+ * 大模块 share
+ * 小模块
+ * 表 XM.xm_share_rece_info 分享后接收人行为记录表
+ * 实体 ShareReceInfo
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * id,shareKey,receiverId,receiverName,receTime;
+ * 当前表的所有字段名:
+ * id,share_key,receiver_id,receiver_name,rece_time;
+ * 当前主键(包括多主键):
+ * id;
+ ***/ + @RunWith(SpringJUnit4ClassRunner.class) + @SpringBootTest +public class TestShareReceInfoDao { + + @Autowired + BaseDao baseDao; + + /** + * 新增一条数据 + ***/ + @Test + public void insert() { + Map p=BaseUtils.map("id","1zr2","shareKey","dp61","receiverId","9s6n","receiverName","83i7","receTime",new Date("2021-04-22 17:12:53")); + ShareReceInfo shareReceInfo=BaseUtils.fromMap(p,ShareReceInfo.class); + baseDao.insert(shareReceInfo); + //Assert.assertEquals(1, result); + } +} diff --git a/xm-core/src/test/java/com/xm/share/service/TestShareBizInfoService.java b/xm-core/src/test/java/com/xm/share/service/TestShareBizInfoService.java new file mode 100644 index 00000000..890ca952 --- /dev/null +++ b/xm-core/src/test/java/com/xm/share/service/TestShareBizInfoService.java @@ -0,0 +1,53 @@ +package com.xm.share.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.share.service.ShareBizInfoService; +import com.mdp.mybatis.PageUtils; +import com.github.pagehelper.Page; +import com.xm.share.entity.ShareBizInfo; +import org.springframework.boot.test.context.SpringBootTest; +/** + * ShareBizInfoService的测试案例 + * 组织 com
+ * 顶级模块 xm
+ * 大模块 share
+ * 小模块
+ * 表 XM.xm_share_biz_info 分享行为记录表
+ * 实体 ShareBizInfo
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * shareKey,shareUserid,shareUsername,pageUrl,pageType,shareTime,bizPkId,bizBranchId,shareBranchId,bizSubPkId,params,shareType,pshareKey,pshareUserid,pshareUsername,bizType,bizCategoryId;
+ * 当前表的所有字段名:
+ * share_key,share_userid,share_username,page_url,page_type,share_time,biz_pk_id,biz_branch_id,share_branch_id,biz_sub_pk_id,params,share_type,pshare_key,pshare_userid,pshare_username,biz_type,biz_category_id;
+ * 当前主键(包括多主键):
+ * share_key;
+ ***/ + +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest +public class TestShareBizInfoService { + + @Autowired + ShareBizInfoService shareBizInfoService; + + /** + * 新增一条数据 + ***/ + @Test + public void insert() { + Map p=BaseUtils.map("shareKey","9303","shareUserid","zZoc","shareUsername","V9tr","pageUrl","wBF3","pageType","ylHj","shareTime",new Date("2021-04-22 17:12:53"),"bizPkId","c6DC","bizBranchId","5HjB","shareBranchId","0aSc","bizSubPkId","5ps3","params","b175","shareType","q0Jh","pshareKey","it9W","pshareUserid","IaYJ","pshareUsername","GGIz","bizType","9Uqr","bizCategoryId","FL8C"); + ShareBizInfo shareBizInfo=BaseUtils.fromMap(p,ShareBizInfo.class); + shareBizInfoService.insert(shareBizInfo); + //Assert.assertEquals(1, result); + } + +} diff --git a/xm-core/src/test/java/com/xm/share/service/TestShareReceInfoService.java b/xm-core/src/test/java/com/xm/share/service/TestShareReceInfoService.java new file mode 100644 index 00000000..32c34732 --- /dev/null +++ b/xm-core/src/test/java/com/xm/share/service/TestShareReceInfoService.java @@ -0,0 +1,53 @@ +package com.xm.share.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.share.service.ShareReceInfoService; +import com.mdp.mybatis.PageUtils; +import com.github.pagehelper.Page; +import com.xm.share.entity.ShareReceInfo; +import org.springframework.boot.test.context.SpringBootTest; +/** + * ShareReceInfoService的测试案例 + * 组织 com
+ * 顶级模块 xm
+ * 大模块 share
+ * 小模块
+ * 表 XM.xm_share_rece_info 分享后接收人行为记录表
+ * 实体 ShareReceInfo
+ * 表是指数据库结构中的表,实体是指java类型中的实体类
+ * 当前实体所有属性名:
+ * id,shareKey,receiverId,receiverName,receTime;
+ * 当前表的所有字段名:
+ * id,share_key,receiver_id,receiver_name,rece_time;
+ * 当前主键(包括多主键):
+ * id;
+ ***/ + +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest +public class TestShareReceInfoService { + + @Autowired + ShareReceInfoService shareReceInfoService; + + /** + * 新增一条数据 + ***/ + @Test + public void insert() { + Map p=BaseUtils.map("id","1zr2","shareKey","dp61","receiverId","9s6n","receiverName","83i7","receTime",new Date("2021-04-22 17:12:53")); + ShareReceInfo shareReceInfo=BaseUtils.fromMap(p,ShareReceInfo.class); + shareReceInfoService.insert(shareReceInfo); + //Assert.assertEquals(1, result); + } + +}