Commit 93972071 authored by litengwei's avatar litengwei

代码提交

parent ff4c6fbb
......@@ -23,6 +23,11 @@ public enum ProjectInitiationEnum {
设计负责人指定项目资料员("","设计项目负责人分配资料员","","设计项目负责人分配资料员","设计项目负责人分配资料员","待审核"),
安装负责人指定项目负责人("","安装负责人分配项目负责人","","安装负责人分配项目负责人","安装负责人分配项目负责人","待审核"),
安装负责人指定项目资料员("","安装项目负责人分配资料员","","安装项目负责人分配资料员","安装项目负责人分配资料员","待审核"),
建设单位资料员预审("","建设单位资料员预审","","建设单位资料员预审","建设单位资料员预审","待审核"),
项目负责任人审核("","项目负责任人审核","","项目负责任人审核","项目负责任人审核","待审核"),
负责人审批("","负责人审批","","负责人审批","负责人审批","待审核"),
提交指定("6","提交指定","TJZL","","",""),
安装资料审核("","安装资料审核","AZZLSH","安装资料待审核","安装资料审核","待审核"),
......
......@@ -58,6 +58,7 @@ public class XJConstant {
public static final String SJZL_PRESON = "sjzlPerson";
public static final String AZFZ_PRESON = "azfzPerson";
public static final String AZZL_PRESON = "azzlPerson";
public static final String CONDITION = "condition";
/**
* 构造方法
......
......@@ -282,6 +282,7 @@ public class ProjectController extends BaseController {
String sjzl = json.getString(XJConstant.SJZL_PRESON);
String azfz = json.getString(XJConstant.AZFZ_PRESON);
String azzl = json.getString(XJConstant.AZZL_PRESON);
String condition = json.getString(XJConstant.CONDITION);
if(!ValidationUtil.isEmpty(insPerson)){
Map map = orgServiceImpl.getdetialInfo(insDepId);
jsonObject.put(XJConstant.INS_PRESON,insPerson);
......@@ -332,6 +333,10 @@ public class ProjectController extends BaseController {
if(ValidationUtil.isEmpty(option)){
option = "1";
}
if(condition.equals("0")) {
option = "0";
}
projectInitiationService.execute(project.getInstanceId(),jsonObject,option,null);
return ResponseHelper.buildResponse("ok");
}
......
......@@ -172,9 +172,14 @@ public class TaskController {
Long amosBizCode = reginParams.getBusinessInfo().getAmosBizCode();
List<RoleModel> roleModels = reginParams.getUserModel().getOrgRoles().get(amosBizCode);
ArrayList<String> roleIds = new ArrayList<>();
if(null == roleModels) {
roleModels = reginParams.getUserModel().getOrgRoles().get(reginParams.getDepartment().getSequenceNbr());
}
roleModels.forEach(item ->{
roleIds.add(String.valueOf(item.getSequenceNbr()));
});
IPage<Task> page = new Page(current,size);
// LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq(Task::getUnitId,unitId);
......
......@@ -102,7 +102,7 @@ public class ProblemInitiationServiceImpl {
}
qualityProblem.setInstanceId(instanceId);
try {
qualityProblem.setStatus(projectInitiationService.getFlowTaskName(instanceId));
qualityProblem.setStatus(projectInitiationService.getFlowTaskName(null,false,null,null,null,null,null,null,instanceId));
} catch (Exception e) {
e.printStackTrace();
}
......@@ -441,7 +441,7 @@ public class ProblemInitiationServiceImpl {
wrapper.eq(QualityProblem::getInstanceId,instanceId);
QualityProblem qualityProblem = qualityProblemService.getOne(wrapper);
try {
qualityProblem.setStatus(projectInitiationService.getFlowTaskName(instanceId));
qualityProblem.setStatus(projectInitiationService.getFlowTaskName(null,false,null,null,null,null,null,null,instanceId));
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -62,7 +62,7 @@ public class ProcessRelationServiceImpl extends BaseService<ProcessRelationDto,
ProcessRelation processRelation = this.getOne(wrapper);
try {
if(ValidationUtil.isEmpty(taskName)) {
taskName = projectInitiationService.getFlowTaskName(instanceId);
taskName = projectInitiationService.getFlowTaskName(null,false,null,null,null,null,null,null,instanceId);
}
processRelation.setStatus(taskName);
this.updateById(processRelation);
......
......@@ -204,7 +204,7 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
}
String taskName = null;
try {
taskName = getFlowTaskName(instanceId);
taskName = getFlowTaskName(null,false,null,null,null,null,null,null,instanceId);
} catch (Exception e) {
e.printStackTrace();
}
......@@ -313,7 +313,7 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
taskService.saveOrUpdateTask(project.getStatus(), true, taskType, new Date(), project.getSequenceNbr(), TaskTypeEnum.项目立项.getKey(), unitIds,extendId, instanceId);
//更新project种的status字段,更新关系表中的state字段,表示当前流程下一个执行的任务
boolean bool = updateFlowStatus(instanceId);
boolean bool = updateFlowStatus(project.getStatus(), true, taskType, new Date(), project.getSequenceNbr(), TaskTypeEnum.项目立项.getKey(), unitIds,extendId, instanceId);
//如果更新了status状态 新增任务表的状态 待办
if(bool) {
......@@ -346,6 +346,10 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
unitIds.add(project.getConstructionUnitId());
taskType = TaskTypeEnum.填报.getKey();
}
if (ProjectInitiationEnum.建设单位资料员预审.getName().equals(project.getStatus()) || ProjectInitiationEnum.项目负责任人审核.getName().equals(project.getStatus()) || ProjectInitiationEnum.负责人审批.getName().equals(project.getStatus())) {
unitIds.add(project.getConstructionUnitId());
taskType = TaskTypeEnum.流程.getKey();
}
if ( ProjectInitiationEnum.设计负责人指定项目负责人.getName().equals(project.getStatus()) || ProjectInitiationEnum.设计负责人指定项目资料员.getName().equals(project.getStatus()) ||
ProjectInitiationEnum.安装负责人指定项目负责人.getName().equals(project.getStatus()) || ProjectInitiationEnum.安装负责人指定项目资料员.getName().equals(project.getStatus())) {
if(OrgEnum.安装单位.getKey().equals(orgService.getReginParams().getBusinessInfo().getCompanyType())){
......@@ -519,7 +523,7 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
* @param instanceId
* @return
*/
public String getFlowTaskName(String instanceId){
public String getFlowTaskName(String InitiationStatus, boolean status, String taskType, Date sendTime, Long sourceId, String type, List<Long> unitIds,Long extendId, String instanceId){
JSONObject dataObject = new JSONObject();
boolean isEnd = false;
try {
......@@ -539,10 +543,14 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
return ProjectInitiationEnum.提交资料.getName();
}
if(ProjectInitiationEnum.安装负责人指定项目负责人.getName().equals(name)){
return ProjectInitiationEnum.安装负责人指定项目负责人.getName();
if(!taskService.findTheTask(instanceId,ProjectInitiationEnum.安装负责人指定项目负责人.getName())) {
taskService.saveOrUpdateTask(ProjectInitiationEnum.安装负责人指定项目负责人.getName(), false, taskType, sendTime, sourceId, TaskTypeEnum.项目立项.getKey(), unitIds,extendId, instanceId);
}
}
if(ProjectInitiationEnum.设计负责人指定项目负责人.getName().equals(name)){
return ProjectInitiationEnum.设计负责人指定项目负责人.getName();
if(!taskService.findTheTask(instanceId,ProjectInitiationEnum.安装负责人指定项目负责人.getName())) {
taskService.saveOrUpdateTask(ProjectInitiationEnum.设计负责人指定项目负责人.getName(), false, taskType, sendTime, sourceId, TaskTypeEnum.项目立项.getKey(), unitIds,extendId, instanceId);
}
}
if(ProjectInitiationEnum.监检员审核.getName().equals(name)){
isEnd = true;
......@@ -565,20 +573,14 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
OrgServiceImpl orgService;
@BusinessIdentify
public boolean updateFlowStatus(String instanceId){
public boolean updateFlowStatus(String InitiationStatus, boolean status, String taskType, Date sendTime, Long sourceId, String type, List<Long> unitIds,Long extendId, String instanceId){
LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Project::getInstanceId,instanceId);
Project project = projectService.getOne(wrapper);
String taskName = getFlowTaskName(instanceId);
String taskName = getFlowTaskName(InitiationStatus, status, taskType, sendTime, sourceId, type, unitIds,extendId, instanceId);
boolean bool = true;
if (( project.getStatus().contains(ProjectInitiationEnum.安装资料审批.getName()) || project.getStatus().contains(ProjectInitiationEnum.设计资料审批.getName())) && "流程结束!".equals(taskName)){
bool = false;
// if(OrgEnum.安装单位.getKey().equals(orgService.getReginParams().getBusinessInfo().getCompanyType())){
// taskName = ProjectInitiationEnum.设计开工资料提交.getName();
// }
// if(OrgEnum.设计单位.getKey().equals(orgService.getReginParams().getBusinessInfo().getCompanyType())){
// taskName = ProjectInitiationEnum.安装开工资料提交.getName();
// }
}
if(ProjectInitiationEnum.修改资料.getName().equals(project.getStatus()) && ProjectInitiationEnum.监检员审核.getName().equals(taskName)){
String companyType = orgService.getReginParams().getBusinessInfo().getCompanyType();
......@@ -630,13 +632,13 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
return bool;
}
public void updateProjectFlowStatus(String instanceId){
LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Project::getInstanceId,instanceId);
Project project = projectService.getOne(wrapper);
project.setStatus(getFlowTaskName(instanceId));
projectService.updateById(project);
}
// public void updateProjectFlowStatus(String instanceId){
// LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq(Project::getInstanceId,instanceId);
// Project project = projectService.getOne(wrapper);
// project.setStatus(getFlowTaskName(instanceId));
// projectService.updateById(project);
// }
@Override
......
......@@ -234,4 +234,17 @@ public class TaskServiceImpl extends BaseService<TaskDto, Task, TaskMapper> impl
}
}
public boolean findTheTask(String instanceId, String title) {
LambdaQueryWrapper<Task> lambda = new QueryWrapper<Task>().lambda();
lambda.eq(Task::getInstanceId, instanceId);
lambda.eq(Task::getTitle, title);
List<Task> tasks = this.getBaseMapper().selectList(lambda);
if (!ObjectUtils.isEmpty(tasks)) {
return true;
} else {
return false;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment