|
@@ -17,6 +17,9 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
import platform.common.Constant;
|
|
import platform.common.Constant;
|
|
|
import platform.common.base.model.Dict;
|
|
import platform.common.base.model.Dict;
|
|
|
|
|
+import platform.common.base.model.Template;
|
|
|
|
|
+import platform.common.base.service.DictionaryItemService;
|
|
|
|
|
+import platform.common.base.service.TemplateService;
|
|
|
import platform.common.util.CommonUtils;
|
|
import platform.common.util.CommonUtils;
|
|
|
import platform.common.util.DateUtil;
|
|
import platform.common.util.DateUtil;
|
|
|
import platform.common.util.HttpClientUtil;
|
|
import platform.common.util.HttpClientUtil;
|
|
@@ -25,7 +28,9 @@ import platform.modules.build.entity.BuildingInfo;
|
|
|
import platform.modules.build.entity.Company;
|
|
import platform.modules.build.entity.Company;
|
|
|
import platform.modules.build.service.*;
|
|
import platform.modules.build.service.*;
|
|
|
import platform.modules.company.entity.ProjectApplication;
|
|
import platform.modules.company.entity.ProjectApplication;
|
|
|
|
|
+import platform.modules.company.entity.ProjectMaterial;
|
|
|
import platform.modules.company.service.ProjectApplicationService;
|
|
import platform.modules.company.service.ProjectApplicationService;
|
|
|
|
|
+import platform.modules.company.service.ProjectMaterialService;
|
|
|
import platform.modules.government.dao.PolicyDao;
|
|
import platform.modules.government.dao.PolicyDao;
|
|
|
import platform.modules.government.dto.PolicyDetailDto;
|
|
import platform.modules.government.dto.PolicyDetailDto;
|
|
|
import platform.modules.government.dto.PolicyDto;
|
|
import platform.modules.government.dto.PolicyDto;
|
|
@@ -269,6 +274,16 @@ public class Task {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ProjectService projectService;
|
|
private ProjectService projectService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ProjectMaterialService projectMaterialService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DictionaryItemService dictionaryItemService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private TemplateService templateService;
|
|
|
|
|
+
|
|
|
|
|
+// @Scheduled(cron = "0/15 * * * * ?")
|
|
|
@Scheduled(cron = "0 30 23 * * ?")
|
|
@Scheduled(cron = "0 30 23 * * ?")
|
|
|
public void CorrectApplicationType() throws Exception {
|
|
public void CorrectApplicationType() throws Exception {
|
|
|
|
|
|
|
@@ -304,6 +319,37 @@ public class Task {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ List<ProjectMaterial> newProjectMaterialList = new ArrayList<>();
|
|
|
|
|
+ List<Template> templateList = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ example = new Example(ProjectMaterial.class);
|
|
|
|
|
+ criteria = example.createCriteria();
|
|
|
|
|
+ criteria.andEqualTo("apply_id", projectApplication.getId());
|
|
|
|
|
+ List<ProjectMaterial> projectMaterialList = projectMaterialService.selectByExample(example);
|
|
|
|
|
+ if (CommonUtils.isNotNull(projectMaterialList)) {
|
|
|
|
|
+ for (ProjectMaterial projectMaterial : projectMaterialList) {
|
|
|
|
|
+ if (CommonUtils.isNull(projectMaterial.getContent())) {
|
|
|
|
|
+ newProjectMaterialList.add(projectMaterial);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ Project project = projectService.findById(projectApplication.getProject_id());
|
|
|
|
|
+ if (null != project) {
|
|
|
|
|
+ Integer itemId = dictionaryItemService.findIdByTypeAndNameActive(Constant.DictionaryType.PROJECT_NAME, project.getProject_name());
|
|
|
|
|
+ example = new Example(Template.class);
|
|
|
|
|
+ criteria = example.createCriteria();
|
|
|
|
|
+ criteria.andEqualTo("item_id", itemId);
|
|
|
|
|
+ templateList = templateService.selectByExample(example);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (templateList.size() == newProjectMaterialList.size()) {
|
|
|
|
|
+ for (int i = 0; i < newProjectMaterialList.size(); i++) {
|
|
|
|
|
+ if (!Objects.equals(newProjectMaterialList.get(i).getTemplate_id(), templateList.get(i).getId())) {
|
|
|
|
|
+ newProjectMaterialList.get(i).setTemplate_id(templateList.get(i).getId());
|
|
|
|
|
+ projectMaterialService.updateSelective(newProjectMaterialList.get(i));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|