Authored by qinchao

工单发布新功能

... ... @@ -2,6 +2,8 @@ package com.model;
import lombok.Data;
import java.util.List;
/**
* Created by zhengyouwei on 2016/9/2.
* <p>
... ...
... ... @@ -42,6 +42,12 @@ public class ReleaseWorkJob {
*/
private String project;
/**
* 分支
*/
private String branch;
/**
* 所需的集成测试
* 对应java项目
... ...
... ... @@ -9,6 +9,8 @@
<result column="platform" property="platform" jdbcType="VARCHAR" />
<result column="project" property="project" jdbcType="VARCHAR" />
<result column="branch" property="branch" jdbcType="VARCHAR" />
<result column="testId" property="testId" jdbcType="VARCHAR" />
<result column="testMessage" property="testMessage" jdbcType="VARCHAR" />
... ... @@ -22,7 +24,7 @@
</resultMap>
<sql id="Base_Column_List" >
id, title,demand,environment,platform,project,testId,testMessage,develop,test,operator,status,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') AS createTime,DATE_FORMAT(update_time,'%Y-%m-%d %H:%i:%S') AS updateTime
id, title,demand,environment,platform,project,branch,testId,testMessage,develop,test,operator,status,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') AS createTime,DATE_FORMAT(update_time,'%Y-%m-%d %H:%i:%S') AS updateTime
</sql>
<select id="selectCount" resultType="java.lang.Integer">
... ... @@ -87,6 +89,7 @@
environment,
platform,
project,
branch,
testId,
testMessage,
develop,
... ... @@ -103,6 +106,7 @@
#{environment,jdbcType=VARCHAR},
#{platform,jdbcType=VARCHAR},
#{project,jdbcType=VARCHAR},
#{branch,jdbcType=VARCHAR},
#{testId,jdbcType=VARCHAR},
#{testMessage,jdbcType=VARCHAR},
#{develop,jdbcType=VARCHAR},
... ...
... ... @@ -5,6 +5,6 @@
<configuration>
<settings>
<setting name="defaultStatementTimeout" value="2"/> <!-- seconds -->
<!--<setting name="logImpl" value="STDOUT_LOGGING" />-->
<setting name="logImpl" value="STDOUT_LOGGING" />
</settings>
</configuration>
\ No newline at end of file
... ...
... ... @@ -13,6 +13,9 @@ public class HandlerRole {
public static final String DBA = "dba";
//DB 类型的工单可以选择组长审核
public static final String DB_TEAM_LEADER_VERIFY="verifier";
public static final String LEADER = "leader";
}
... ...
... ... @@ -104,7 +104,7 @@ public class DBServiceImpl implements DBService {
PendingJob pendingJob = new PendingJob(WorkType.DB_PROJECT, dbWorkJob.getId(), dbWorkJob.getTitle(), null, HandlerRole.DBA, WorkStatus.PUBLISH);
workSystemSupport.addPendingByRole(pendingJob, false);
}else{//选择审核人,则只有当前审核人来处理该工单
PendingJob pendingJob = new PendingJob(WorkType.DB_PROJECT, dbWorkJob.getId(), dbWorkJob.getTitle(),dbWorkJob.getVerifier(),"verifier",WorkStatus.PUBLISH_UNCHECK);
PendingJob pendingJob = new PendingJob(WorkType.DB_PROJECT, dbWorkJob.getId(), dbWorkJob.getTitle(),dbWorkJob.getVerifier(),HandlerRole.DB_TEAM_LEADER_VERIFY,WorkStatus.PUBLISH_UNCHECK);
workSystemSupport.addPendingJob(pendingJob,false);
}
... ...
... ... @@ -194,7 +194,7 @@ public class ReleaseServiceImpl implements ReleaseService {
if(handleType == HandleType.PASS){//领导通过
releaseWorkJob.setStatus(WorkStatus.LEADER_PASS);
releaseWorkJobMapper.updateStatus(releaseWorkJob);
PendingJob newPendingJob = new PendingJob(WorkType.RELEASE_PROJECT, releaseWorkJob.getId(), releaseWorkJob.getTitle(), null, HandlerRole.OPERATOR, WorkStatus.LEADER_PASS);
PendingJob newPendingJob = new PendingJob(WorkType.RELEASE_PROJECT, releaseWorkJob.getId(), releaseWorkJob.getTitle(), null, HandlerRole.OPERATOR+","+HandlerRole.LEADER, WorkStatus.LEADER_PASS);
workSystemSupport.addPendingByRole(newPendingJob,false);
}else{//领导未通过
releaseWorkJob.setStatus(WorkStatus.CREATED);//置为初始状态
... ...
... ... @@ -19,10 +19,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
/**
* Created by zhengyouwei on 2016/9/2.
... ... @@ -160,8 +157,11 @@ public class WorkSystemSupport {
* @param pendingJob
*/
public void addPendingByRole(PendingJob pendingJob, boolean sendLeader) {
String role = pendingJob.getHandlerRole();
List<User> list = userMapper.selectUsersByRole(role);
String roles = pendingJob.getHandlerRole();
List<User> list = new ArrayList<User>();
for(String role:roles.split(",")){
list.addAll(userMapper.selectUsersByRole(role));
}
StringBuilder mobileBuilder = new StringBuilder();
Mail.Builder builder = Mail.Builder(pendingJob.getType() + "_工单待办");
for (User user : list) {
... ...