From 23fbcdc454a517d24278e813b38a38f8f0871d1c Mon Sep 17 00:00:00 2001 From: ma <1062634917@qq.com> Date: Fri, 2 Apr 2021 16:06:55 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=99=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=88=A0=E9=99=A4=E6=8F=92=E4=BB=B6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ccsens/tall/service/SysPluginService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tall/src/main/java/com/ccsens/tall/service/SysPluginService.java b/tall/src/main/java/com/ccsens/tall/service/SysPluginService.java index 820249d2..c53410db 100644 --- a/tall/src/main/java/com/ccsens/tall/service/SysPluginService.java +++ b/tall/src/main/java/com/ccsens/tall/service/SysPluginService.java @@ -277,8 +277,10 @@ public class SysPluginService implements ISysPluginService{ ProTaskPluginExample taskPluginExample = new ProTaskPluginExample(); taskPluginExample.createCriteria().andPluginIdEqualTo(param.getPluginId()) .andTaskDetailIdEqualTo(taskDetail.getId()) - .andMemberRoleIdNotEqualTo(param.getRoleId()); - taskPluginDao.deleteByExample(taskPluginExample); + .andMemberRoleIdEqualTo(param.getRoleId()); + ProTaskPlugin taskPlugin = new ProTaskPlugin(); + taskPlugin.setRecStatus((byte)2); + taskPluginDao.updateByExampleSelective(taskPlugin,taskPluginExample); }else { throw new BaseException("权限不足"); } From cc9c3e78ec5dd39bf607d7537fc02aee7c313010 Mon Sep 17 00:00:00 2001 From: ma <1062634917@qq.com> Date: Fri, 2 Apr 2021 17:00:15 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=8B=E7=9A=84=E6=8F=92=E4=BB=B6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccsens/tall/service/SysPluginService.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tall/src/main/java/com/ccsens/tall/service/SysPluginService.java b/tall/src/main/java/com/ccsens/tall/service/SysPluginService.java index c53410db..0c2110f4 100644 --- a/tall/src/main/java/com/ccsens/tall/service/SysPluginService.java +++ b/tall/src/main/java/com/ccsens/tall/service/SysPluginService.java @@ -95,7 +95,12 @@ public class SysPluginService implements ISysPluginService{ */ @Override public List findPluginOfAdded(PluginDto.FindPluginByTask param) { - List plugins = taskPluginDao.findPluginOfAdded(param.getTaskId(),param.getRoleId(),param.getPluginName(),param.getPluginType()); + //查找分解任务,通过分级任务找到任务详情 + ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(param.getTaskId()); + if (ObjectUtil.isNull(proTaskSubTime)){ + throw new BaseException("获取任务信息错误"); + } + List plugins = taskPluginDao.findPluginOfAdded(proTaskSubTime.getTaskDetailId(),param.getRoleId(),param.getPluginName(),param.getPluginType()); plugins.forEach(plugin -> { if (plugin.getFileIdList().contains(",")){ String[] split = plugin.getFileIdList().split(","); @@ -143,8 +148,14 @@ public class SysPluginService implements ISysPluginService{ */ @Override public PageInfo findPluginOfNoAdded(PluginDto.FindPluginByTaskNo param) { + //查找分解任务,通过分级任务找到任务详情 + ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(param.getTaskId()); + if (ObjectUtil.isNull(proTaskSubTime)){ + throw new BaseException("获取任务信息错误"); + } + PageHelper.startPage(param.getPageNum(),param.getPageSize()); - List plugins = taskPluginDao.findPluginOfNoAdded(param.getTaskId(),param.getRoleId(),param.getPluginName(),param.getPluginType()); + List plugins = taskPluginDao.findPluginOfNoAdded(proTaskSubTime.getTaskDetailId(),param.getRoleId(),param.getPluginName(),param.getPluginType()); plugins.forEach(plugin -> { if (plugin.getFileIdList().contains(",")){ String[] split = plugin.getFileIdList().split(","); From 20e6fcd1ffd38f108ff14c5aac7273bc42aafe6e Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Tue, 6 Apr 2021 09:30:47 +0800 Subject: [PATCH 03/15] 20210406v1.0 --- .../ccsens/tall/service/InputDocService.java | 26 +------------ .../tall/service/ProTaskDetailService.java | 1 + .../com/ccsens/tall/service/RobotService.java | 39 ++++++++++--------- .../ccsens/tall/web/InputDocController.java | 7 +++- 4 files changed, 29 insertions(+), 44 deletions(-) diff --git a/tall/src/main/java/com/ccsens/tall/service/InputDocService.java b/tall/src/main/java/com/ccsens/tall/service/InputDocService.java index e27f4d0c..ddbb6b89 100644 --- a/tall/src/main/java/com/ccsens/tall/service/InputDocService.java +++ b/tall/src/main/java/com/ccsens/tall/service/InputDocService.java @@ -51,8 +51,6 @@ public class InputDocService implements IInputDocService { private ProTaskInputDocMapper proTaskInputDocMapper; @Resource private Snowflake snowflake; - @Resource - private FileMapper fileMapper; @@ -198,26 +196,6 @@ public class InputDocService implements IInputDocService { } -// if (record.getFileIds().contains(",")){ -// String[] split = record.getFileIds().split(","); -// for (int i = 0; i < split.length; i++) { -// -// -//// File file = fileMapper.selectByPrimaryKey(Long.valueOf(split[i])); -//// InputDocVo.File nowFile = new InputDocVo.File(); -//// nowFile.setFileName(file.getFileName()); -//// nowFile.setFileUrl(file.getVisitLocation()); -//// record.getFileList().add(nowFile); -// } -// }else{ -// if (StrUtil.isNotBlank(record.getFileIds())){ -//// File file = fileMapper.selectByPrimaryKey(Long.valueOf(record.getFileIds())); -//// InputDocVo.File nowFile = new InputDocVo.File(); -//// nowFile.setFileName(file.getFileName()); -//// nowFile.setFileUrl(file.getVisitLocation()); -//// record.getFileList().add(nowFile); -// } -// } } } return docByTasks; @@ -281,6 +259,7 @@ public class InputDocService implements IInputDocService { proTaskInputDocMapper.updateByPrimaryKeySelective(proTaskInputDoc); } + //TODO 发送消息 } @@ -292,8 +271,7 @@ public class InputDocService implements IInputDocService { */ @Override public List viewDocHistory(InputDocDto.ViewDocHistory param) { - List historyRecords = iInputDocDao.viewDocHistory(param.getDocId()); - return historyRecords; + return iInputDocDao.viewDocHistory(param.getDocId()); } /** diff --git a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java index 6a46754c..be43e90d 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java @@ -1473,6 +1473,7 @@ public class ProTaskDetailService implements IProTaskDetailService { } else { throw new BaseException(CodeEnum.NOT_TASK); } + //发送消息 robotService.changeTaskRobotSend(currentUserId, normalTask); return normalTask; } diff --git a/tall/src/main/java/com/ccsens/tall/service/RobotService.java b/tall/src/main/java/com/ccsens/tall/service/RobotService.java index a94a4cdc..9ebd1475 100644 --- a/tall/src/main/java/com/ccsens/tall/service/RobotService.java +++ b/tall/src/main/java/com/ccsens/tall/service/RobotService.java @@ -22,6 +22,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.util.Arrays; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; @@ -31,27 +32,27 @@ import java.util.concurrent.atomic.AtomicInteger; @Service @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) public class RobotService implements IRobotService{ - @Autowired + @Resource private SysProjectDao sysProjectDao; - @Autowired + @Resource private SysRobotDao sysRobotDao; - @Autowired + @Resource private SysProjectRobotDao sysProjectRobotDao; - @Autowired + @Resource private SysMessageTypeDao sysMessageTypeDao; - @Autowired + @Resource private SysProjectRobotMessageDao projectRobotMessageDao; - @Autowired + @Resource private RedisUtil redisUtil; - @Autowired + @Resource private IUserService userService; - @Autowired + @Resource private IProRoleService proRoleService; - @Autowired + @Resource private IProMemberService proMemberService; - @Autowired + @Resource private TaskDetailDao taskDetailDao; - @Autowired + @Resource private TaskSubTimeDao taskSubTimeDao; @Override @@ -67,9 +68,7 @@ public class RobotService implements IRobotService{ String content = getRobotTemplate(operateType.value()); //获取发送参数 final String[] builder = {content}; - message.getParams().forEach(param->{ - builder[0] = builder[0].replace(param.getName(),param.getContent()); - }); + message.getParams().forEach(param-> builder[0] = builder[0].replace(param.getName(),param.getContent())); //获取机器人信息 SysRobot sysRobot = sysRobotDao.selectByPrimaryKey(sysProjectRobot.getRobotId()); @@ -111,7 +110,7 @@ public class RobotService implements IRobotService{ @Override public String getRobotTemplate(int code){ String robotKey = TallConstant.getRobotTemplateKey(code); - String template = ""; + String template; template = (String)redisUtil.get(robotKey); if(StrUtil.isEmpty(template)){ SysMessageTypeExample sysMessageTypeExample = new SysMessageTypeExample(); @@ -145,7 +144,7 @@ public class RobotService implements IRobotService{ @Override public void finishTaskRobotSend(Long currentUserId,Long projectId, String projectName, String taskName,Long executorRoleId , int completedStatus) throws Exception { String userName = userService.getUserNameByUserId(currentUserId); - String isFinish = ""; + String isFinish; if(completedStatus == 2){ isFinish = "完成"; }else { @@ -252,7 +251,6 @@ public class RobotService implements IRobotService{ RobotUtil.setWxTemplate(WxTemplateUtil.getChangeTask(normalTask.getProjectId(), userName, normalTask.getName())); } - @Override public void addDeliverRobotSend(Long currentUserId, String deliverName, Long subTimeId,SysProject project) throws Exception { String userName = userService.getUserNameByUserId(currentUserId); @@ -388,7 +386,9 @@ public class RobotService implements IRobotService{ RobotUtil.setWxTemplate(WxTemplateUtil.getAddComment(project.getId(), userName)); } - + /** + * 通过机器人发送提醒消息 + */ @Override public void sendRemindByRobot(TaskVo.RemindTask taskRemind,String content) throws Exception { String[] rolePhone = getMemberPhonesByRoleId(taskRemind.getExecutorRole()); @@ -419,4 +419,7 @@ public class RobotService implements IRobotService{ }); } } + + + } diff --git a/tall/src/main/java/com/ccsens/tall/web/InputDocController.java b/tall/src/main/java/com/ccsens/tall/web/InputDocController.java index c44a22f4..ec6a0e91 100644 --- a/tall/src/main/java/com/ccsens/tall/web/InputDocController.java +++ b/tall/src/main/java/com/ccsens/tall/web/InputDocController.java @@ -9,6 +9,7 @@ import com.ccsens.tall.bean.vo.LabelVo; import com.ccsens.tall.service.IInputDocService; import com.ccsens.util.JsonResponse; import com.ccsens.util.WebConstant; +import com.ccsens.util.annotation.OperateType; import com.ccsens.util.bean.dto.QueryDto; import io.jsonwebtoken.Claims; import io.swagger.annotations.Api; @@ -31,7 +32,7 @@ import java.util.List; @RequestMapping("/inputDoc") public class InputDocController { - @Autowired + @Resource private IInputDocService iInputDocService; /*@MustLogin @@ -54,6 +55,7 @@ public class InputDocController { return JsonResponse.newInstance().ok(docByTask); } + @OperateType(value = 15) @MustLogin @ApiOperation(value = "给输入文档上传文件", notes = "1007:给输入文档上传文件") @RequestMapping(value = "/uploadForDoc", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @@ -93,7 +95,7 @@ public class InputDocController { log.info("修改输入文档"); return JsonResponse.newInstance().ok(); } - + @OperateType(value = 16) @MustLogin @ApiOperation(value = "删除输入文档", notes = "1007:删除输入文档") @RequestMapping(value = "/delDoc", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @@ -114,6 +116,7 @@ public class InputDocController { return JsonResponse.newInstance().ok(); } + @OperateType(value = 14) @MustLogin @ApiOperation(value = "修改上传文件的备注信息", notes = "1007:修改上传文件的备注信息") @RequestMapping(value = "/updateDocOfRemark", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) From 2f7c611b8268e77f063b9b83adfa3f4d4ce45845 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Tue, 6 Apr 2021 10:22:15 +0800 Subject: [PATCH 04/15] 20210406v1.1 --- .../com/ccsens/tall/aspect/RobotAspect.java | 2 +- .../java/com/ccsens/tall/bean/vo/MessageVo.java | 17 +++++++++++++++++ .../com/ccsens/tall/service/RobotService.java | 6 +++--- .../com/ccsens/tall/web/InputDocController.java | 8 ++++---- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/tall/src/main/java/com/ccsens/tall/aspect/RobotAspect.java b/tall/src/main/java/com/ccsens/tall/aspect/RobotAspect.java index 32dc3edb..4bbd4c16 100644 --- a/tall/src/main/java/com/ccsens/tall/aspect/RobotAspect.java +++ b/tall/src/main/java/com/ccsens/tall/aspect/RobotAspect.java @@ -44,7 +44,7 @@ public class RobotAspect { RobotUtil.Message message = RobotUtil.getRobotMessage(); MessageVo.Inform inform = RobotUtil.getInform(); WxTemplateMessage wxTemplate = RobotUtil.getWxTemplate(); - // 3.机器人通知 + // 3.企业微信群机器人通知 asyncService.sendRobotMessage(operateType,message); // 4.ws和公众号通知 asyncService.sendMessage(operateType, inform, wxTemplate); diff --git a/tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java b/tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java index a09d3c7d..97b0dabd 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java +++ b/tall/src/main/java/com/ccsens/tall/bean/vo/MessageVo.java @@ -204,4 +204,21 @@ public class MessageVo { .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.TaskName.value,taskName)); return inform; } + + /** + * 上传输入文档 + * @param userId + * @param userName + * @param projectId + * @param projectName + * @param taskName + * @return + */ + public static Inform uploadForDocComment(Long userId, String userName, Long projectId, String projectName, String taskName,String deliverName) { + MessageVo.Inform inform = new MessageVo.Inform(projectId, userId); + inform.appendMessage(new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName)) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.ProjectName.value, projectName, WebConstant.Message.TYPE_LINK, Message.getProjectSettings(projectId))) + .appendMessage(new MessageVo.Message(WebConstant.TemplateParam.TaskName.value,taskName)); + return inform; + } } diff --git a/tall/src/main/java/com/ccsens/tall/service/RobotService.java b/tall/src/main/java/com/ccsens/tall/service/RobotService.java index 9ebd1475..0ccc1521 100644 --- a/tall/src/main/java/com/ccsens/tall/service/RobotService.java +++ b/tall/src/main/java/com/ccsens/tall/service/RobotService.java @@ -172,18 +172,18 @@ public class RobotService implements IRobotService{ @Override public void addTaskRobotSend(Long currentUserId, SysProject project, String taskName, Long executorId) throws Exception { - + //通过userID获取用户名 String userName = userService.getUserNameByUserId(currentUserId); String projectName = ""; - + //获取项目名 if(ObjectUtil.isNotNull(project)){ projectName = project.getName(); } // 获取角色名 TaskVo.RoleCheckList role = proRoleService.selectRoleByCheckOrExecutor(executorId); String executorName = ObjectUtil.isNotNull(role) ? role.getName() : ""; - + //将需填充的信息放到消息内 RobotUtil.Message message = new RobotUtil.Message(project.getId()); message.appendParams( new MessageVo.Message(WebConstant.TemplateParam.Operator.value, userName), diff --git a/tall/src/main/java/com/ccsens/tall/web/InputDocController.java b/tall/src/main/java/com/ccsens/tall/web/InputDocController.java index ec6a0e91..7d20d2e6 100644 --- a/tall/src/main/java/com/ccsens/tall/web/InputDocController.java +++ b/tall/src/main/java/com/ccsens/tall/web/InputDocController.java @@ -45,7 +45,7 @@ public class InputDocController { return JsonResponse.newInstance().ok(); }*/ - @MustLogin + @MustLoginTall @ApiOperation(value = "通过任务id查询输入文档", notes = "1007:通过任务id查询输入文档") @RequestMapping(value = "/docByTask", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse> findDocByTask(@ApiParam @Validated @RequestBody QueryDto params) { @@ -56,7 +56,7 @@ public class InputDocController { } @OperateType(value = 15) - @MustLogin + @MustLoginTall @ApiOperation(value = "给输入文档上传文件", notes = "1007:给输入文档上传文件") @RequestMapping(value = "/uploadForDoc", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse uploadForDoc(@ApiParam @Validated @RequestBody QueryDto params) { @@ -66,7 +66,7 @@ public class InputDocController { return JsonResponse.newInstance().ok(); } - @MustLogin + @MustLoginTall @ApiOperation(value = "查看文档上传历史记录", notes = "1007:查看文档上传历史记录") @RequestMapping(value = "/viewDocHistory", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse viewDocHistory(@ApiParam @Validated @RequestBody QueryDto params) { @@ -76,7 +76,7 @@ public class InputDocController { return JsonResponse.newInstance().ok(historyRecords); } - @MustLogin + @MustLoginTall @ApiOperation(value = "添加输入文档", notes = "1007:添加输入文档") @RequestMapping(value = "/addDoc", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse addDoc(@ApiParam @Validated @RequestBody QueryDto params) { From ae3907679c4d6fb32f948975aad821935e223703 Mon Sep 17 00:00:00 2001 From: ma <1062634917@qq.com> Date: Tue, 6 Apr 2021 10:22:57 +0800 Subject: [PATCH 05/15] 20210406 --- .../ccsens/tall/persist/mapper/SysOperationMessageMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMessageMapper.java b/tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMessageMapper.java index e6d044c0..54dda60a 100644 --- a/tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMessageMapper.java +++ b/tall/src/main/java/com/ccsens/tall/persist/mapper/SysOperationMessageMapper.java @@ -1,6 +1,6 @@ package com.ccsens.tall.persist.mapper; -import com.ccsens.tall.bean.po.SysOperationMessage; +import com.ccsens.tall.bean.po.SysOperation; import com.ccsens.tall.bean.po.SysOperationMessageExample; import java.util.List; import org.apache.ibatis.annotations.Param; From e39db9ad02f8226a0b75c0b1c1d3aa876d618620 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Tue, 6 Apr 2021 17:19:24 +0800 Subject: [PATCH 06/15] =?UTF-8?q?20210406=E4=BF=AE=E6=94=B9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=BE=93=E5=85=A5=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccsens/tall/bean/dto/TaskDto.java | 2 +- .../java/com/ccsens/tall/bean/vo/RoleVo.java | 1 - .../ccsens/tall/service/InputDocService.java | 19 +++++++++++++++++-- tall/src/main/resources/application.yml | 4 ++-- .../resources/mapper_dao/IInputDocDao.xml | 5 ++--- .../resources/mapper_dao/TaskDetailDao.xml | 2 +- 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java b/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java index c4474a31..115ec1fc 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java +++ b/tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java @@ -86,7 +86,7 @@ public class TaskDto { @ApiModel("添加时设置任务提醒") public static class TaskRemindByAdd{ @ApiModelProperty("提醒时机 0不提醒 1开始前,2开始时,3开始后,4结束前,5结束时,6结束后,7自定义时间") - private Byte remindTiming; + private Byte remindTiming = 0; @ApiModelProperty("时长 提醒时机是“开始时”或“结束时”可以为空") private Long duration = 0L; @ApiModelProperty("时间单位 0分钟 1小时 2天") diff --git a/tall/src/main/java/com/ccsens/tall/bean/vo/RoleVo.java b/tall/src/main/java/com/ccsens/tall/bean/vo/RoleVo.java index e28a5382..81364a5c 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/vo/RoleVo.java +++ b/tall/src/main/java/com/ccsens/tall/bean/vo/RoleVo.java @@ -1,6 +1,5 @@ package com.ccsens.tall.bean.vo; -import com.sun.org.apache.xpath.internal.operations.Bool; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; diff --git a/tall/src/main/java/com/ccsens/tall/service/InputDocService.java b/tall/src/main/java/com/ccsens/tall/service/InputDocService.java index ddbb6b89..c70fabd6 100644 --- a/tall/src/main/java/com/ccsens/tall/service/InputDocService.java +++ b/tall/src/main/java/com/ccsens/tall/service/InputDocService.java @@ -18,6 +18,8 @@ import com.ccsens.tall.bean.vo.InputDocVo; import com.ccsens.tall.bean.vo.LwbsVo; import com.ccsens.tall.bean.vo.TaskVo; import com.ccsens.tall.persist.dao.IInputDocDao; +import com.ccsens.tall.persist.dao.TaskDetailDao; +import com.ccsens.tall.persist.dao.TaskSubTimeDao; import com.ccsens.tall.persist.mapper.*; import com.ccsens.tall.util.TaskUtil; @@ -51,7 +53,10 @@ public class InputDocService implements IInputDocService { private ProTaskInputDocMapper proTaskInputDocMapper; @Resource private Snowflake snowflake; - + @Resource + private TaskDetailDao taskDetailDao; + @Resource + private TaskSubTimeDao taskSubTimeDao; @Override @@ -171,7 +176,17 @@ public class InputDocService implements IInputDocService { */ @Override public List findDocByTask(InputDocDto.FindDocByTask param) { - List docByTasks = iInputDocDao.findDocByTask(param.getTaskId()); + //查询任务分解后 + ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(param.getTaskId()); + if(ObjectUtil.isNull(proTaskSubTime)){ + throw new BaseException(CodeEnum.NOT_TASK); + } + //查询任务详情 + ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(proTaskSubTime.getTaskDetailId()); + if(ObjectUtil.isNull(taskDetail)){ + throw new BaseException(CodeEnum.NOT_TASK); + } + List docByTasks = iInputDocDao.findDocByTask(taskDetail.getId()); for (InputDocVo.DocOfTask docs:docByTasks){ for (InputDocVo.Record record:docs.getRecords()){ if(ObjectUtil.isNotNull(record.getFileIds())) { diff --git a/tall/src/main/resources/application.yml b/tall/src/main/resources/application.yml index ebc544af..b5408a3a 100644 --- a/tall/src/main/resources/application.yml +++ b/tall/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: test - include: util-test,common + active: dev + include: util-dev,common diff --git a/tall/src/main/resources/mapper_dao/IInputDocDao.xml b/tall/src/main/resources/mapper_dao/IInputDocDao.xml index 367191cb..560b5867 100644 --- a/tall/src/main/resources/mapper_dao/IInputDocDao.xml +++ b/tall/src/main/resources/mapper_dao/IInputDocDao.xml @@ -159,12 +159,11 @@ tir.remark AS remark FROM t_pro_task_input_doc AS tid - LEFT JOIN t_pro_task_input_record AS tir ON tid.id = tir.input_doc_id + LEFT JOIN t_pro_task_input_record AS tir ON tid.id = tir.input_doc_id and tir.rec_status = 0 WHERE tid.task_detail_id = #{taskId} - AND tid.is_upload = 1 AND tid.rec_status = 0 - AND tir.rec_status = 0 + + + \ No newline at end of file diff --git a/tall/src/main/resources/mapper_dao/SysOperationMessageDao.xml b/tall/src/main/resources/mapper_dao/SysOperationMessageDao.xml new file mode 100644 index 00000000..2d178cc9 --- /dev/null +++ b/tall/src/main/resources/mapper_dao/SysOperationMessageDao.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/tall/src/main/resources/mapper_raw/SysOperationMapper.xml b/tall/src/main/resources/mapper_raw/SysOperationMapper.xml index bc28230a..2f541658 100644 --- a/tall/src/main/resources/mapper_raw/SysOperationMapper.xml +++ b/tall/src/main/resources/mapper_raw/SysOperationMapper.xml @@ -10,6 +10,7 @@ + @@ -71,7 +72,7 @@ id, operator_id, project_id, operate_type, operation_time, created_at, updated_at, - rec_status + rec_status, task_detail_id @@ -199,6 +208,9 @@ rec_status = #{record.recStatus,jdbcType=TINYINT}, + + task_detail_id = #{record.taskDetailId,jdbcType=BIGINT}, + @@ -213,7 +225,8 @@ operation_time = #{record.operationTime,jdbcType=BIGINT}, created_at = #{record.createdAt,jdbcType=TIMESTAMP}, updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, - rec_status = #{record.recStatus,jdbcType=TINYINT} + rec_status = #{record.recStatus,jdbcType=TINYINT}, + task_detail_id = #{record.taskDetailId,jdbcType=BIGINT} @@ -242,6 +255,9 @@ rec_status = #{recStatus,jdbcType=TINYINT}, + + task_detail_id = #{taskDetailId,jdbcType=BIGINT}, + where id = #{id,jdbcType=BIGINT} @@ -253,7 +269,8 @@ operation_time = #{operationTime,jdbcType=BIGINT}, created_at = #{createdAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP}, - rec_status = #{recStatus,jdbcType=TINYINT} + rec_status = #{recStatus,jdbcType=TINYINT}, + task_detail_id = #{taskDetailId,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT} \ No newline at end of file From 8c4c21cb1af8714d5102cb6519e4fe0d70808329 Mon Sep 17 00:00:00 2001 From: ma <1062634917@qq.com> Date: Thu, 8 Apr 2021 18:43:39 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=A6=81=E5=B1=95=E7=A4=BA=E7=9A=84=E8=A7=92=E8=89=B2=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccsens/tall/bean/dto/InputDocDto.java | 8 +++++ .../ccsens/tall/persist/dao/ProRoleDao.java | 8 +++++ .../ccsens/tall/service/IInputDocService.java | 6 ++++ .../ccsens/tall/service/InputDocService.java | 20 +++++++++++ .../ccsens/tall/service/ProRoleService.java | 20 ++++++++--- .../ccsens/tall/web/InputDocController.java | 12 ++++++- .../main/resources/mapper_dao/ProRoleDao.xml | 34 +++++++++++++++++++ 7 files changed, 102 insertions(+), 6 deletions(-) diff --git a/tall/src/main/java/com/ccsens/tall/bean/dto/InputDocDto.java b/tall/src/main/java/com/ccsens/tall/bean/dto/InputDocDto.java index d08b4e35..099f2890 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/dto/InputDocDto.java +++ b/tall/src/main/java/com/ccsens/tall/bean/dto/InputDocDto.java @@ -113,5 +113,13 @@ public class InputDocDto { } + @Data + @ApiModel("删除输入文档下所有的文件") + public static class DelAllRecordOfTask{ + @NotNull(message = "请选择输入文档") + @ApiModelProperty("输入文档id") + private Long docId; + } + } diff --git a/tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleDao.java b/tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleDao.java index ca3fe9e5..fa532290 100644 --- a/tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleDao.java +++ b/tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleDao.java @@ -17,6 +17,7 @@ public interface ProRoleDao extends ProRoleMapper{ List selectFirstRoleByProjectIdAndUserId(@Param("projectId") Long projectId, @Param("userId") Long userId); List selectSecondRolesByProjectId(@Param("projectId") Long projectId); + List selectSecondRolesShowByProjectId(@Param("projectId") Long projectId); List selectCareLessRoleByProjectIdAndUserId(@Param("projectId") Long projectId, @Param("userId") Long currentUserId); @@ -85,6 +86,13 @@ public interface ProRoleDao extends ProRoleMapper{ */ List queryRoleShowslistBefore(Long projectId, List listBeforeId); + /** + * 根据角色id查询要展示的角色 + * @param projectId + * @return + */ + List selectSecondRolesShowByRoleId(@Param("projectId") Long projectId,@Param("roleIdList") List roleIdList); + // /** // * 查找项目下的所有成员的名字用“,”分隔 // * @param projectId 项目id diff --git a/tall/src/main/java/com/ccsens/tall/service/IInputDocService.java b/tall/src/main/java/com/ccsens/tall/service/IInputDocService.java index 5566bcf3..2d769a92 100644 --- a/tall/src/main/java/com/ccsens/tall/service/IInputDocService.java +++ b/tall/src/main/java/com/ccsens/tall/service/IInputDocService.java @@ -92,4 +92,10 @@ public interface IInputDocService { * @return */ PageInfo findDocRecordByTask(InputDocDto.FindDocRecordByTask param); + + /** + * 删除输入文档下所有的文件 + * @param param 输入文档id + */ + void delAllRecordOfTask(InputDocDto.DelAllRecordOfTask param); } diff --git a/tall/src/main/java/com/ccsens/tall/service/InputDocService.java b/tall/src/main/java/com/ccsens/tall/service/InputDocService.java index 72012d90..8d8e1ae7 100644 --- a/tall/src/main/java/com/ccsens/tall/service/InputDocService.java +++ b/tall/src/main/java/com/ccsens/tall/service/InputDocService.java @@ -471,4 +471,24 @@ public class InputDocService implements IInputDocService { return new PageInfo<>(sysOperations); } + /** + * 删除输入文档下所有的文件 + * @param param 输入文档id + */ + @Override + public void delAllRecordOfTask(InputDocDto.DelAllRecordOfTask param) { + ProTaskInputRecordExample example = new ProTaskInputRecordExample(); + example.createCriteria().andInputDocIdEqualTo(param.getDocId()).andRecStatusEqualTo((byte)0); + List records = proTaskInputRecordMapper.selectByExample(example); + if (ObjectUtil.isNotNull(records)){ + ProTaskInputRecordExample example2 = new ProTaskInputRecordExample(); + example2.createCriteria().andInputDocIdEqualTo(param.getDocId()); + ProTaskInputRecord proTaskInputRecord = new ProTaskInputRecord(); + proTaskInputRecord.setRecStatus((byte)2); + proTaskInputRecordMapper.updateByExampleSelective(proTaskInputRecord,example2); + } + //TODO 文档 改回未上传状态 + + } + } diff --git a/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java b/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java index 553be54b..6f16f9d2 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProRoleService.java @@ -254,7 +254,7 @@ public class ProRoleService implements IProRoleService { @Override public List getRealMemberRolesShowByProjectId(Long projectId,Long userId) { //返回的对象 - List memberRoleList = null; + List memberRoleList; //先从userid和项目id获取当前用户的成员id,查看role-show里面是否有这个成员的数据 ProMemberExample proMemberExample=new ProMemberExample(); @@ -290,8 +290,8 @@ public class ProRoleService implements IProRoleService { proMemberRoleShowMapper.insertSelective(proMemberRoleShow); }); } + //这里插入项目经理 - //查一下项目经理的角色id, ProRoleExample proRoleExample=new ProRoleExample(); proRoleExample.createCriteria().andRecStatusEqualTo((byte)0).andNameEqualTo(WebConstant.ROLE_NAME.PM.value).andParentIdEqualTo(0L).andProjectIdEqualTo(projectId); @@ -313,7 +313,7 @@ public class ProRoleService implements IProRoleService { //判断该成员是不是项目经理 ProMemberRoleExample proMemberRoleExample1=new ProMemberRoleExample(); - proMemberRoleExample.createCriteria().andRecStatusEqualTo((byte)0).andMemberIdEqualTo(memberId).andRoleIdEqualTo(jili1.get(0)); + proMemberRoleExample1.createCriteria().andRecStatusEqualTo((byte)0).andMemberIdEqualTo(memberId).andRoleIdEqualTo(jili1.get(0)); List proMemberRoles1 = proMemberRoleMapper.selectByExample(proMemberRoleExample1); if(CollectionUtil.isEmpty(proMemberRoles1)){ isPm[0]=false; @@ -352,8 +352,18 @@ public class ProRoleService implements IProRoleService { } } } -// //查询二级角色 -// memberRoleList = proRoleDao.selectSecondRolesShowByProjectId(projectId); + + //查看角色展示列表中是否有数据 + ProMemberRoleShowExample proMemberRoleShowExampleNew=new ProMemberRoleShowExample(); + proMemberRoleShowExampleNew.createCriteria().andMemberIdEqualTo(memberId); + List proMemberRoleShowsNew = proMemberRoleShowMapper.selectByExample(proMemberRoleShowExampleNew); + + List roleIds = new ArrayList<>(); + for (ProMemberRoleShow roleShow : proMemberRoleShowsNew) { + roleIds.add(roleShow.getRoleId()); + } + //查询二级角色 + memberRoleList = proRoleDao.selectSecondRolesShowByRoleId(projectId,roleIds); //在show表查找可见的角色 return memberRoleList; diff --git a/tall/src/main/java/com/ccsens/tall/web/InputDocController.java b/tall/src/main/java/com/ccsens/tall/web/InputDocController.java index 3c0c901b..556bd62e 100644 --- a/tall/src/main/java/com/ccsens/tall/web/InputDocController.java +++ b/tall/src/main/java/com/ccsens/tall/web/InputDocController.java @@ -71,7 +71,7 @@ public class InputDocController { @MustLoginTall @ApiOperation(value = "查看文档上传历史记录", notes = "1007:查看文档上传历史记录") @RequestMapping(value = "/viewDocHistory", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) - public JsonResponse viewDocHistory(@ApiParam @Validated @RequestBody QueryDto params) { + public JsonResponse> viewDocHistory(@ApiParam @Validated @RequestBody QueryDto params) { log.info("查看文档上传历史记录:{}",params); List historyRecords = iInputDocService.viewDocHistory(params.getParam()); log.info("查看文档上传历史记录"); @@ -140,4 +140,14 @@ public class InputDocController { return JsonResponse.newInstance().ok(docRecordByTask); } + @MustLoginTall + @ApiOperation(value = "删除输入文档下所有的文件", notes = "1007:删除输入文档下所有的文件") + @RequestMapping(value = "/delAllRecordOfTask", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse delAllRecordOfTask(@ApiParam @Validated @RequestBody QueryDto params) { + log.info("删除输入文档下所有的文件:{}",params); + iInputDocService.delAllRecordOfTask(params.getParam()); + log.info("删除输入文档下所有的文件"); + return JsonResponse.newInstance().ok(); + } + } diff --git a/tall/src/main/resources/mapper_dao/ProRoleDao.xml b/tall/src/main/resources/mapper_dao/ProRoleDao.xml index 3624e021..753292ee 100644 --- a/tall/src/main/resources/mapper_dao/ProRoleDao.xml +++ b/tall/src/main/resources/mapper_dao/ProRoleDao.xml @@ -124,6 +124,40 @@ AND (m.rec_status = 0 or m.rec_status is null) + +