...
|
...
|
@@ -77,7 +77,12 @@ public class DBServiceImpl implements DBService { |
|
|
|
|
|
dbWorkJob.setId(workId);
|
|
|
//插入发布工单表
|
|
|
dbWorkJob.setStatus(WorkStatus.PUBLISH);
|
|
|
if(dbWorkJob.getVerifier() == null ||"".equals(dbWorkJob.getVerifier())){//未选择审核人,不需要被审核
|
|
|
dbWorkJob.setStatus(WorkStatus.PUBLISH);
|
|
|
}else{
|
|
|
dbWorkJob.setStatus(WorkStatus.PUBLISH_UNCHECK);//选择审核人,待审核状态
|
|
|
}
|
|
|
|
|
|
int result = dbWorkJobMapper.insert(dbWorkJob);
|
|
|
if (result < 1) {
|
|
|
return -1;
|
...
|
...
|
@@ -88,8 +93,14 @@ public class DBServiceImpl implements DBService { |
|
|
handledJobMapper.insert(handledJob);
|
|
|
|
|
|
//插入用户待处理工单表
|
|
|
PendingJob pendingJob = new PendingJob(WorkType.DB_PROJECT, dbWorkJob.getId(), dbWorkJob.getTitle(), null, HandlerRole.DBA, WorkStatus.PUBLISH);
|
|
|
workSystemSupport.addPendingByRole(pendingJob, false);
|
|
|
if("".equals(dbWorkJob.getVerifier())){//未选择工单审核人,则按照旧的流程走
|
|
|
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);
|
|
|
workSystemSupport.addPendingJob(pendingJob,false);
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -122,7 +133,7 @@ public class DBServiceImpl implements DBService { |
|
|
return 1;
|
|
|
}
|
|
|
int currentStatus = pendingJob.getCurrentStatus();
|
|
|
if (currentStatus == WorkStatus.PUBLISH) {
|
|
|
if (currentStatus == WorkStatus.PUBLISH || currentStatus == WorkStatus.PUBLISH_CHECKED) {//发布状态或者 发布后审核通过状态,按照之前的流程走
|
|
|
dbWorkJob.setDba(handledJob.getHandler());
|
|
|
if (handleType == HandleType.PASS) {//通过
|
|
|
if (StringUtils.equals("true", handledJob.getDbNeedTest())) {//需要测试
|
...
|
...
|
@@ -160,6 +171,21 @@ public class DBServiceImpl implements DBService { |
|
|
dbWorkJob.setStatus(WorkStatus.EXE_FAILE);//发布失败
|
|
|
workSystemSupport.workend(dbWorkJob.getId(), WorkType.DB_PROJECT, dbWorkJob.getTitle(), WorkStatus.getCstatus(WorkStatus.EXE_FAILE));
|
|
|
}
|
|
|
}else if(currentStatus == WorkStatus.PUBLISH_UNCHECK ){//发布待审核状态
|
|
|
dbWorkJob.setDba(handledJob.getHandler());
|
|
|
if (handleType == HandleType.VERIFYPASS) {//通过(默认不需要测试)
|
|
|
dbWorkJob.setStatus(WorkStatus.PUBLISH_CHECKED);
|
|
|
dbWorkJobMapper.update(dbWorkJob);//更新,下一步需要 重新查询
|
|
|
//给审核人及领导发送审核通过通知
|
|
|
workSystemSupport.workend(dbWorkJob.getId(), WorkType.DB_PROJECT, dbWorkJob.getTitle(), WorkStatus.getCstatus(WorkStatus.PUBLISH_CHECKED));
|
|
|
//给dba发送审核通知---参照旧流程
|
|
|
PendingJob p = new PendingJob(WorkType.DB_PROJECT, dbWorkJob.getId(), dbWorkJob.getTitle(), null, HandlerRole.DBA, WorkStatus.PUBLISH_CHECKED);
|
|
|
workSystemSupport.addPendingByRole(p, false);
|
|
|
}else{//拒绝(默认不需要测试)
|
|
|
dbWorkJob.setStatus(WorkStatus.EXE_FAILE);
|
|
|
workSystemSupport.workend(dbWorkJob.getId(), WorkType.DB_PROJECT, dbWorkJob.getTitle(), WorkStatus.getCstatus(WorkStatus.EXE_FAILE));
|
|
|
|
|
|
}
|
|
|
}
|
|
|
dbWorkJobMapper.update(dbWorkJob);//填写工单结果
|
|
|
return 1;
|
...
|
...
|
|