|
|
@ -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{ |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|