|
@@ -110,63 +110,63 @@ public class JobTask {
|
|
|
|
|
|
|
|
// TODO: 2024-9-25 从广联达获取mdm项目
|
|
// TODO: 2024-9-25 从广联达获取mdm项目
|
|
|
protected void pullProjectFromGldMaster() throws Exception {
|
|
protected void pullProjectFromGldMaster() throws Exception {
|
|
|
- Connection connection = null;
|
|
|
|
|
- try {
|
|
|
|
|
- connection = dataSource.getConnection();
|
|
|
|
|
- connection.setAutoCommit(false);
|
|
|
|
|
-
|
|
|
|
|
- List<GldProject> existGLDList = jdbcClient.getJdbcList(new HashMap<>(), GldProject.class, connection);
|
|
|
|
|
- List<ProjectInfo> existProjList = jdbcClient.getJdbcList(new HashMap<>(), ProjectInfo.class, connection);
|
|
|
|
|
- List<GldProject> list = gldMasterService.getGetProject();
|
|
|
|
|
- for (GldProject model : list) {
|
|
|
|
|
- List<GldProject> filterList = existGLDList.stream().filter(exist -> model.getId().equals(exist.getId()))
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
- if (filterList.size() > 0) {
|
|
|
|
|
- jdbcClient.jdbcUpdateById(model, connection);
|
|
|
|
|
- } else {
|
|
|
|
|
- jdbcClient.jdbcInsert(model, connection);
|
|
|
|
|
- }
|
|
|
|
|
- List<ProjectInfo> filterProjList = existProjList.stream()
|
|
|
|
|
- .filter(exist -> model.getId().equals(exist.getId())).collect(Collectors.toList());
|
|
|
|
|
- ProjectInfo info = new ProjectInfo();
|
|
|
|
|
- info.setId(model.getId());
|
|
|
|
|
- info.setProjectAddr(model.getAddress());
|
|
|
|
|
- info.setProjectName(model.getProjectName());
|
|
|
|
|
- info.setProjectNo(model.getCode());
|
|
|
|
|
- if (model.getActive()) {
|
|
|
|
|
- info.setProjectStatus("active");
|
|
|
|
|
- } else {
|
|
|
|
|
- info.setProjectStatus("inactive");
|
|
|
|
|
- }
|
|
|
|
|
- info.setGldProjectId(null);
|
|
|
|
|
- GldDept gldDept = new GldDept();
|
|
|
|
|
- gldDept.setId(model.getDeptId());
|
|
|
|
|
- gldDept = jdbcClient.getJdbcModel(gldDept, connection);
|
|
|
|
|
- if (StringUtil.isEmpty(gldDept.getCode())) {
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- SysDept dept = new SysDept();
|
|
|
|
|
- dept.setCode(gldDept.getCode());
|
|
|
|
|
- dept = jdbcClient.getJdbcModel(dept, connection);
|
|
|
|
|
- if (StringUtil.isEmpty(dept.getDeptId())) {
|
|
|
|
|
- info.setDeptId((long) 1);
|
|
|
|
|
- } else {
|
|
|
|
|
- info.setDeptId(dept.getDeptId());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (filterProjList.size() > 0) {
|
|
|
|
|
- jdbcClient.jdbcUpdateById(info, connection);
|
|
|
|
|
- } else {
|
|
|
|
|
- jdbcClient.jdbcInsert(info, connection);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- connection.commit();
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- connection.rollback();
|
|
|
|
|
- throw e;
|
|
|
|
|
- } finally {
|
|
|
|
|
- jdbcClient.finallyExecute(connection);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// Connection connection = null;
|
|
|
|
|
+// try {
|
|
|
|
|
+// connection = dataSource.getConnection();
|
|
|
|
|
+// connection.setAutoCommit(false);
|
|
|
|
|
+//
|
|
|
|
|
+// List<GldProject> existGLDList = jdbcClient.getJdbcList(new HashMap<>(), GldProject.class, connection);
|
|
|
|
|
+// List<ProjectInfo> existProjList = jdbcClient.getJdbcList(new HashMap<>(), ProjectInfo.class, connection);
|
|
|
|
|
+// List<GldProject> list = gldMasterService.getGetProject();
|
|
|
|
|
+// for (GldProject model : list) {
|
|
|
|
|
+// List<GldProject> filterList = existGLDList.stream().filter(exist -> model.getId().equals(exist.getId()))
|
|
|
|
|
+// .collect(Collectors.toList());
|
|
|
|
|
+// if (filterList.size() > 0) {
|
|
|
|
|
+// jdbcClient.jdbcUpdateById(model, connection);
|
|
|
|
|
+// } else {
|
|
|
|
|
+// jdbcClient.jdbcInsert(model, connection);
|
|
|
|
|
+// }
|
|
|
|
|
+// List<ProjectInfo> filterProjList = existProjList.stream()
|
|
|
|
|
+// .filter(exist -> model.getId().equals(exist.getId())).collect(Collectors.toList());
|
|
|
|
|
+// ProjectInfo info = new ProjectInfo();
|
|
|
|
|
+// info.setId(model.getId());
|
|
|
|
|
+// info.setProjectAddr(model.getAddress());
|
|
|
|
|
+// info.setProjectName(model.getProjectName());
|
|
|
|
|
+// info.setProjectNo(model.getCode());
|
|
|
|
|
+// if (model.getActive()) {
|
|
|
|
|
+// info.setProjectStatus("active");
|
|
|
|
|
+// } else {
|
|
|
|
|
+// info.setProjectStatus("inactive");
|
|
|
|
|
+// }
|
|
|
|
|
+// info.setGldProjectId(null);
|
|
|
|
|
+// GldDept gldDept = new GldDept();
|
|
|
|
|
+// gldDept.setId(model.getDeptId());
|
|
|
|
|
+// gldDept = jdbcClient.getJdbcModel(gldDept, connection);
|
|
|
|
|
+// if (StringUtil.isEmpty(gldDept.getCode())) {
|
|
|
|
|
+// continue;
|
|
|
|
|
+// }
|
|
|
|
|
+// SysDept dept = new SysDept();
|
|
|
|
|
+// dept.setCode(gldDept.getCode());
|
|
|
|
|
+// dept = jdbcClient.getJdbcModel(dept, connection);
|
|
|
|
|
+// if (StringUtil.isEmpty(dept.getDeptId())) {
|
|
|
|
|
+// info.setDeptId((long) 1);
|
|
|
|
|
+// } else {
|
|
|
|
|
+// info.setDeptId(dept.getDeptId());
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// if (filterProjList.size() > 0) {
|
|
|
|
|
+// jdbcClient.jdbcUpdateById(info, connection);
|
|
|
|
|
+// } else {
|
|
|
|
|
+// jdbcClient.jdbcInsert(info, connection);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// connection.commit();
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// connection.rollback();
|
|
|
|
|
+// throw e;
|
|
|
|
|
+// } finally {
|
|
|
|
|
+// jdbcClient.finallyExecute(connection);
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
protected void pullTenantFromGldMaster() throws Exception {
|
|
protected void pullTenantFromGldMaster() throws Exception {
|