|
|
@@ -12,6 +12,7 @@ import com.hz.pm.api.external.todo.MHTodoClient; |
|
|
|
import com.hz.pm.api.external.todo.dto.MhTodoExtraParamDTO; |
|
|
|
import com.hz.pm.api.projectlib.model.entity.Project; |
|
|
|
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum; |
|
|
|
import com.hz.pm.api.projectlib.service.IMhProjectService; |
|
|
|
import com.hz.pm.api.projectlib.service.IProjectService; |
|
|
|
import com.hz.pm.api.sys.entity.MhTodoRecord; |
|
|
|
import com.hz.pm.api.sys.service.IMhTodoRecordService; |
|
|
@@ -28,6 +29,7 @@ import org.springframework.stereotype.Component; |
|
|
|
import javax.annotation.PostConstruct; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import static com.hz.pm.api.external.todo.enumerization.MHTodoTypeEnum.DECLARED_RECORD_APPLY; |
|
|
@@ -50,6 +52,7 @@ public class DeclaredRecordReminderTask extends ReminderTask { |
|
|
|
private final MHTodoClient mhTodoClient; |
|
|
|
private final MhUnitCache mhUnitCache; |
|
|
|
private final UserInfoHelper userInfoHelper; |
|
|
|
private final IMhProjectService mhProjectService; |
|
|
|
|
|
|
|
|
|
|
|
public DeclaredRecordReminderTask(Environment environment, |
|
|
@@ -58,7 +61,8 @@ public class DeclaredRecordReminderTask extends ReminderTask { |
|
|
|
MhApiClient mhApiClient, |
|
|
|
MHTodoClient mhTodoClient, |
|
|
|
MhUnitCache mhUnitCache, |
|
|
|
UserInfoHelper userInfoHelper) { |
|
|
|
UserInfoHelper userInfoHelper, |
|
|
|
IMhProjectService mhProjectService) { |
|
|
|
super(environment); |
|
|
|
this.projectService = projectService; |
|
|
|
this.todoRecordService = todoRecordService; |
|
|
@@ -66,6 +70,7 @@ public class DeclaredRecordReminderTask extends ReminderTask { |
|
|
|
this.mhTodoClient = mhTodoClient; |
|
|
|
this.mhUnitCache = mhUnitCache; |
|
|
|
this.userInfoHelper = userInfoHelper; |
|
|
|
this.mhProjectService = mhProjectService; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@@ -104,6 +109,10 @@ public class DeclaredRecordReminderTask extends ReminderTask { |
|
|
|
for (Project project : projects) { |
|
|
|
try { |
|
|
|
String projectCode = project.getProjectCode(); |
|
|
|
Optional<Long> mhProjectId = mhProjectService.getIdByProjectCode(projectCode); |
|
|
|
if (!mhProjectId.isPresent()) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
String buildOrgCode = project.getBuildOrgCode(); |
|
|
|
UnitDTO unit = unitMap.get(buildOrgCode); |
|
|
|
if (unit == null) { |
|
|
@@ -127,7 +136,9 @@ public class DeclaredRecordReminderTask extends ReminderTask { |
|
|
|
MhTodoExtraParamDTO paramObj = MhTodoExtraParamDTO.builder() |
|
|
|
.projectId(project.getId()) |
|
|
|
.projectCode(projectCode) |
|
|
|
.path("/declareManage/projectFiling") |
|
|
|
.mhProjectId(mhProjectId.get()) |
|
|
|
.status(project.getStatus()) |
|
|
|
.path("/declareManage/projectFilingEdit") |
|
|
|
.userId(user.getUserId()) |
|
|
|
.userName(user.getRealName()) |
|
|
|
.build(); |
|
|
|