From 9b03504b2152af4b5d833a266baa1ac9d66a29e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Sat, 11 Jun 2022 13:14:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=81=9A=E6=88=90=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/ctrl/XmIterationMenuController.java | 2 +- .../com/xm/core/ctrl/XmMyFocusController.java | 188 ------------------ .../java/com/xm/core/entity/XmMyFocus.java | 155 +++------------ .../mapper/xm/core/dao/XmMyFocusMapper.xml | 138 +++++++------ 4 files changed, 109 insertions(+), 374 deletions(-) delete mode 100644 xm-core/src/main/java/com/xm/core/ctrl/XmMyFocusController.java diff --git a/xm-core/src/main/java/com/xm/core/ctrl/XmIterationMenuController.java b/xm-core/src/main/java/com/xm/core/ctrl/XmIterationMenuController.java index de992938..76dd2692 100644 --- a/xm-core/src/main/java/com/xm/core/ctrl/XmIterationMenuController.java +++ b/xm-core/src/main/java/com/xm/core/ctrl/XmIterationMenuController.java @@ -187,7 +187,7 @@ public class XmIterationMenuController { if(menus==null || menus.size()==0){ return ResponseHelper.failed("no-qx-0","无权限操作"); } - List canOpList=new ArrayList<>(); + List canOpList=menus; List hadJoin=new ArrayList<>(); List ntype1=new ArrayList<>(); List status789=new ArrayList<>(); diff --git a/xm-core/src/main/java/com/xm/core/ctrl/XmMyFocusController.java b/xm-core/src/main/java/com/xm/core/ctrl/XmMyFocusController.java deleted file mode 100644 index de1afe4a..00000000 --- a/xm-core/src/main/java/com/xm/core/ctrl/XmMyFocusController.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.xm.core.ctrl; - -import com.mdp.core.entity.Tips; -import com.mdp.core.err.BizException; -import com.mdp.core.utils.RequestUtils; -import com.mdp.mybatis.PageUtils; -import com.xm.core.entity.XmMyFocus; -import com.xm.core.service.XmMyFocusService; -import com.xm.core.service.XmRecordService; -import io.swagger.annotations.*; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * url编制采用rest风格,如对XM.xm_my_focus xm_my_focus的操作有增删改查,对应的url分别为:
- * 新增: xm/xmMyFocus/add
- * 查询: xm/xmMyFocus/list
- * 模糊查询: xm/xmMyFocus/listKey
- * 修改: xm/xmMyFocus/edit
- * 删除: xm/xmMyFocus/del
- * 批量删除: xm/xmMyFocus/batchDel
- * 组织 com.qqkj 顶级模块 oa 大模块 xm 小模块
- * 实体 XmMyFocus 表 XM.xm_my_focus 当前主键(包括多主键): id; - ***/ -@RestController("xm.core.xmMyFocusController") -@RequestMapping(value="/**/xm/core/xmMyFocus") -@Api(tags={"xm_my_focus操作接口"}) -public class XmMyFocusController { - - static Log logger=LogFactory.getLog(XmMyFocusController.class); - - @Autowired - private XmMyFocusService xmMyFocusService; - - - - @Autowired - XmRecordService xmRecordService; - - @ApiOperation( value = "查询xm_my_focus信息列表",notes="listXmMyFocus,条件之间是 and关系,模糊查询写法如 {studentName:'%才哥%'}") - @ApiImplicitParams({ - @ApiImplicitParam(name="id",value="主键,主键",required=false), - @ApiImplicitParam(name="userid",value="用户编号",required=false), - @ApiImplicitParam(name="username",value="用户名称",required=false), - @ApiImplicitParam(name="taskId",value="关注的任务主键",required=false), - @ApiImplicitParam(name="focusType",value="对象类型项目-project/任务-task",required=false), - @ApiImplicitParam(name="projectId",value="项目编号",required=false), - @ApiImplicitParam(name="projectName",value="项目名称",required=false), - @ApiImplicitParam(name="taskName",value="任务名称",required=false), - @ApiImplicitParam(name="pageSize",value="每页记录数",required=false), - @ApiImplicitParam(name="pageNum",value="当前页码,从1开始",required=false), - @ApiImplicitParam(name="total",value="总记录数,服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算",required=false), - @ApiImplicitParam(name="orderBy",value="排序列 如性别、学生编号排序 orderBy = sex desc,student_id desc",required=false), - @ApiImplicitParam(name="count",value="是否进行总条数计算,count=true|false",required=false) - }) - @ApiResponses({ - @ApiResponse(code = 200,response= XmMyFocus.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'错误码'},total:总记录数,data:[数据对象1,数据对象2,...]}") - }) - @RequestMapping(value="/list",method=RequestMethod.GET) - public Map listXmMyFocus( @ApiIgnore @RequestParam Map xmMyFocus){ - Map m = new HashMap<>(); - RequestUtils.transformArray(xmMyFocus, "ids"); - PageUtils.startPage(xmMyFocus); - List> xmMyFocusList = xmMyFocusService.selectListMapByWhere(xmMyFocus); //列出XmMyFocus列表 - PageUtils.responePage(m, xmMyFocusList); - m.put("data",xmMyFocusList); - Tips tips=new Tips("查询成功"); - m.put("tips", tips); - return m; - } - - - - /***/ - @ApiOperation( value = "新增一条xm_my_focus信息",notes="addXmMyFocus,主键如果为空,后台自动生成") - @ApiResponses({ - @ApiResponse(code = 200,response=XmMyFocus.class,message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") - }) - @RequestMapping(value="/add",method=RequestMethod.POST) - public Map addXmMyFocus(@RequestBody XmMyFocus xmMyFocus) { - Map m = new HashMap<>(); - Tips tips=new Tips("成功关注"); - try{ - if(StringUtils.isEmpty(xmMyFocus.getId())) { - xmMyFocus.setId(xmMyFocusService.createKey("id")); - }else{ - XmMyFocus xmMyFocusQuery = new XmMyFocus(xmMyFocus.getId()); - if(xmMyFocusService.countByWhere(xmMyFocusQuery)>0){ - tips.setFailureMsg("编号重复,请修改编号再提交"); - m.put("tips", tips); - return m; - } - } - xmMyFocusService.focus(xmMyFocus); - - m.put("data",xmMyFocus); - }catch (BizException e) { - tips=e.getTips(); - logger.error("",e); - }catch (Exception e) { - tips.setFailureMsg(e.getMessage()); - logger.error("",e); - } - m.put("tips", tips); - return m; - } - - - /** */ - @ApiOperation( value = "删除一条xm_my_focus信息",notes="delXmMyFocus,仅需要上传主键字段") - @ApiResponses({ - @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}}") - }) - @RequestMapping(value="/del",method=RequestMethod.POST) - public Map delXmMyFocus(@RequestBody XmMyFocus xmMyFocus){ - Map m = new HashMap<>(); - Tips tips=new Tips("取消关注成功"); - try{ - xmMyFocusService.unfocus(xmMyFocus); - }catch (BizException e) { - tips=e.getTips(); - logger.error("",e); - }catch (Exception e) { - tips.setFailureMsg(e.getMessage()); - logger.error("",e); - } - m.put("tips", tips); - return m; - } - - - /** - @ApiOperation( value = "根据主键修改一条xm_my_focus信息",notes="editXmMyFocus") - @ApiResponses({ - @ApiResponse(code = 200,response=XmMyFocus.class, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'},data:数据对象}") - }) - @RequestMapping(value="/edit",method=RequestMethod.POST) - public Map editXmMyFocus(@RequestBody XmMyFocus xmMyFocus) { - Map m = new HashMap<>(); - Tips tips=new Tips("成功更新一条数据"); - try{ - xmMyFocusService.updateByPk(xmMyFocus); - m.put("data",xmMyFocus); - }catch (BizException e) { - tips=e.getTips(); - logger.error("",e); - }catch (Exception e) { - tips.setFailureMsg(e.getMessage()); - logger.error("",e); - } - m.put("tips", tips); - return m; - } - */ - - - - /** - @ApiOperation( value = "根据主键列表批量删除xm_my_focus信息",notes="batchDelXmMyFocus,仅需要上传主键字段") - @ApiResponses({ - @ApiResponse(code = 200, message = "{tips:{isOk:true/false,msg:'成功/失败原因',tipscode:'失败时错误码'}") - }) - @RequestMapping(value="/batchDel",method=RequestMethod.POST) - public Map batchDelXmMyFocus(@RequestBody List xmMyFocuss) { - Map m = new HashMap<>(); - Tips tips=new Tips("成功删除"+xmMyFocuss.size()+"条数据"); - try{ - xmMyFocusService.batchDelete(xmMyFocuss); - }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/XmMyFocus.java b/xm-core/src/main/java/com/xm/core/entity/XmMyFocus.java index dc1a2cf7..b517d6da 100644 --- a/xm-core/src/main/java/com/xm/core/entity/XmMyFocus.java +++ b/xm-core/src/main/java/com/xm/core/entity/XmMyFocus.java @@ -1,152 +1,61 @@ -package com.xm.core.entity; +package com.xm.core.entity; +import lombok.Data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; /** - * 组织 com.qqkj 顶级模块 oa 大模块 xm 小模块
+ * 组织 com 顶级模块 xm 大模块 core 小模块
* 实体 XmMyFocus所有属性名:
- * userid,username,taskId,focusType,projectId,id,projectName,taskName;
- * 表 XM.xm_my_focus xm_my_focus的所有字段名:
- * userid,username,task_id,focus_type,project_id,id,project_name,task_name;
+ * "userid","用户编号","username","用户名称","bizId","关注的对象主键","focusType","对象类型:项目-1/任务-2/产品-3/需求-4/bug-5","pbizId","对象上级编号,项目时填项目编号,任务时填项目编号,产品时填产品编号,需求时填产品编号,bug时填产品编号","bizName","任务名称","pbizName","对象上级名称","ftime","关注时间";
* 当前主键(包括多主键):
- * id;
+ * userid,biz_id,pbiz_id;
*/ -@ApiModel(description="xm_my_focus") + @Data +@ApiModel(description="我关注的项目或者任务") public class XmMyFocus implements java.io.Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty(notes="主键,主键",allowEmptyValue=true,example="",allowableValues="") - String id; - - - @ApiModelProperty(notes="用户编号",allowEmptyValue=true,example="",allowableValues="") + @ApiModelProperty(notes="用户编号,主键",allowEmptyValue=true,example="",allowableValues="") String userid; + @ApiModelProperty(notes="关注的对象主键,主键",allowEmptyValue=true,example="",allowableValues="") + String bizId; + + @ApiModelProperty(notes="对象上级编号,项目时填项目编号,任务时填项目编号,产品时填产品编号,需求时填产品编号,bug时填产品编号,主键",allowEmptyValue=true,example="",allowableValues="") + String pbizId; + + @ApiModelProperty(notes="用户名称",allowEmptyValue=true,example="",allowableValues="") String username; - @ApiModelProperty(notes="关注的任务主键",allowEmptyValue=true,example="",allowableValues="") - String taskId; - - @ApiModelProperty(notes="对象类型项目-project/任务-task",allowEmptyValue=true,example="",allowableValues="") + @ApiModelProperty(notes="对象类型:项目-1/任务-2/产品-3/需求-4/bug-5",allowEmptyValue=true,example="",allowableValues="") String focusType; - @ApiModelProperty(notes="项目编号",allowEmptyValue=true,example="",allowableValues="") - String projectId; + @ApiModelProperty(notes="任务名称",allowEmptyValue=true,example="",allowableValues="") + String bizName; - @ApiModelProperty(notes="项目名称",allowEmptyValue=true,example="",allowableValues="") - String projectName; + @ApiModelProperty(notes="对象上级名称",allowEmptyValue=true,example="",allowableValues="") + String pbizName; - @ApiModelProperty(notes="任务名称",allowEmptyValue=true,example="",allowableValues="") - String taskName; + @ApiModelProperty(notes="关注时间",allowEmptyValue=true,example="",allowableValues="") + Date ftime; - /**主键**/ - public XmMyFocus(String id) { - this.id = id; - } - - /**xm_my_focus**/ - public XmMyFocus() { - } - /** - * 用户编号 + *用户编号,关注的对象主键,对象上级编号,项目时填项目编号,任务时填项目编号,产品时填产品编号,需求时填产品编号,bug时填产品编号 **/ - public void setUserid(String userid) { + public XmMyFocus(String userid,String bizId,String pbizId) { this.userid = userid; + this.bizId = bizId; + this.pbizId = pbizId; } - /** - * 用户名称 - **/ - public void setUsername(String username) { - this.username = username; - } - /** - * 关注的任务主键 - **/ - public void setTaskId(String taskId) { - this.taskId = taskId; - } - /** - * 对象类型项目-project/任务-task - **/ - public void setFocusType(String focusType) { - this.focusType = focusType; - } - /** - * 项目编号 - **/ - public void setProjectId(String projectId) { - this.projectId = projectId; - } - /** - * 主键 - **/ - public void setId(String id) { - this.id = id; - } - /** - * 项目名称 - **/ - public void setProjectName(String projectName) { - this.projectName = projectName; - } - /** - * 任务名称 - **/ - public void setTaskName(String taskName) { - this.taskName = taskName; - } - - /** - * 用户编号 - **/ - public String getUserid() { - return this.userid; - } - /** - * 用户名称 - **/ - public String getUsername() { - return this.username; - } - /** - * 关注的任务主键 - **/ - public String getTaskId() { - return this.taskId; - } - /** - * 对象类型项目-project/任务-task - **/ - public String getFocusType() { - return this.focusType; - } - /** - * 项目编号 - **/ - public String getProjectId() { - return this.projectId; - } - /** - * 主键 - **/ - public String getId() { - return this.id; - } - /** - * 项目名称 - **/ - public String getProjectName() { - return this.projectName; - } - /** - * 任务名称 - **/ - public String getTaskName() { - return this.taskName; + + /** + * 我关注的项目或者任务 + **/ + public XmMyFocus() { } } \ No newline at end of file diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMyFocusMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMyFocusMapper.xml index d4816cff..c1f4b9ff 100644 --- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMyFocusMapper.xml +++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMyFocusMapper.xml @@ -3,11 +3,18 @@ - - - - - + + + + and (res.userid, res.biz_id, res.pbiz_id) in + + ( #{item.userid}, #{item.bizId}, #{item.pbizId}) + + + + + + @@ -15,15 +22,9 @@ @@ -39,65 +40,71 @@ - + - - + + insert into xm_my_focus( ) values ( - #{userid},#{username},#{taskId},#{focusType},#{projectId},#{id},#{projectName},#{taskName} + #{userid},#{username},#{bizId},#{focusType},#{pbizId},#{bizName},#{pbizName},#{ftime} ) - delete from xm_my_focus + delete from xm_my_focus res - and userid = #{userid} - and task_id = #{taskId} - and focus_type = #{focusType} - and project_id = #{projectId} - and id = #{id} - + + - delete from xm_my_focus - where id = #{id} + delete from xm_my_focus + where userid = #{userid} and biz_id = #{bizId} and pbiz_id = #{pbizId} - update xm_my_focus + update xm_my_focus - where id = #{id} + where userid = #{userid} and biz_id = #{bizId} and pbiz_id = #{pbizId} - update xm_my_focus + update xm_my_focus - where id = #{id} + where userid = #{userid} and biz_id = #{bizId} and pbiz_id = #{pbizId} - update xm_my_focus + update xm_my_focus set - where id = #{item.id} + where userid = #{item.userid} and biz_id = #{item.bizId} and pbiz_id = #{item.pbizId} + + + + update xm_my_focus + + + + where (userid, biz_id, pbiz_id) in + + ( #{item.userid}, #{item.bizId}, #{item.pbizId}) + + - delete from xm_my_focus - where id in - - #{item.id } - + delete from xm_my_focus + where + (userid, biz_id, pbiz_id) in + + ( #{item.userid}, #{item.bizId}, #{item.pbizId} ) + - userid,username,task_id,focus_type,project_id,id,project_name,task_name + userid,username,biz_id,focus_type,pbiz_id,biz_name,pbiz_name,ftime - + and res.userid = #{userid} and res.username = #{username} - and res.task_id = #{taskId} + and res.biz_id = #{bizId} and res.focus_type = #{focusType} - and res.project_id = #{projectId} - and res.id = #{id} - and res.project_name = #{projectName} - and res.task_name = #{taskName} + and res.pbiz_id = #{pbizId} + and res.biz_name = #{bizName} + and res.pbiz_name = #{pbizName} + and date_format(res.ftime,'%Y-%m-%d') = date_format(#{ftime},'%Y-%m-%d') - userid = #{userid}, username = #{username}, - task_id = #{taskId}, focus_type = #{focusType}, - project_id = #{projectId}, - project_name = #{projectName}, - task_name = #{taskName} + biz_name = #{bizName}, + pbiz_name = #{pbizName}, + ftime = #{ftime} - userid = #{userid}, username = #{username}, - task_id = #{taskId}, focus_type = #{focusType}, - project_id = #{projectId}, - project_name = #{projectName}, - task_name = #{taskName}, + biz_name = #{bizName}, + pbiz_name = #{pbizName}, + ftime = #{ftime}, - userid = #{item.userid}, username = #{item.username}, - task_id = #{item.taskId}, focus_type = #{item.focusType}, - project_id = #{item.projectId}, - project_name = #{item.projectName}, - task_name = #{item.taskName} + biz_name = #{item.bizName}, + pbiz_name = #{item.pbizName}, + ftime = #{item.ftime} \ No newline at end of file