| | |
| | | package com.product.data.sync.util; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.map.MapUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.common.collect.Lists; |
| | |
| | | import com.google.common.collect.Sets; |
| | | import com.product.admin.service.SystemMenusService; |
| | | import com.product.common.lang.StringUtils; |
| | | import com.product.core.cache.DataPoolCacheImpl; |
| | | import com.product.core.cache.DataPoolRefreshCache; |
| | | import com.product.core.config.Global; |
| | | import com.product.core.connection.ConnectionManager; |
| | | import com.product.core.dao.BaseDao; |
| | |
| | | import java.sql.PreparedStatement; |
| | | import java.sql.SQLException; |
| | | import java.util.*; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | | /** |
| | | * Copyright LX |
| | |
| | | */ |
| | | public class BusinessDataSync extends AbstractBaseService implements Runnable { |
| | | private static Logger logger = LoggerFactory.getLogger(SyFeDataService.class); |
| | | @Autowired |
| | | public BaseDao baseDao; |
| | | |
| | | BatchAddData batchAddData; |
| | | |
| | | @Override |
| | | public BaseDao getBaseDao() { |
| | |
| | | this.baseDao = baseDao; |
| | | } |
| | | |
| | | @Autowired |
| | | FileManagerService fileManagerService; |
| | | |
| | | public FileManagerService getFileManagerService() { |
| | |
| | | this.fileManagerService = fileManagerService; |
| | | } |
| | | |
| | | @Autowired |
| | | SystemMenusService systemMenusService; |
| | | |
| | | public SystemMenusService getSystemMenusService() { |
| | |
| | | this.systemMenusService = systemMenusService; |
| | | } |
| | | |
| | | @Autowired |
| | | private FeDataDSService feDataDSService; |
| | | |
| | | public FeDataDSService getFeDataDSService() { |
| | |
| | | |
| | | public void setGdMediaUtil(GdMediaUtil gdMediaUtil) { |
| | | this.gdMediaUtil = gdMediaUtil; |
| | | } |
| | | |
| | | |
| | | public void setBatchAddData(BatchAddData batchAddData) { |
| | | this.batchAddData = batchAddData; |
| | | } |
| | | |
| | | //å
¬å¸fe id å¯¹åº äº§åuuid |
| | |
| | | // private List<String> funTable = Lists.newArrayList("FE_APP5.PUB_NOTICE","FE_BASE5.RESEARCH_TOPIC","FE_APP5.APP_KQLRB","FE_BASE5.SYS_COLLABORATIVE","FE_APP5.BS_MEETING_FLOW"); |
| | | private List<String> funTable = Lists.newArrayList("FE_APP5.PUB_NOTICE", "FE_BASE5.RESEARCH_TOPIC", "FE_APP5.APP_KQLRB", "FE_BASE5.SYS_COLLABORATIVE", "FE_APP5.BS_MEETING_FLOW"); |
| | | |
| | | private Set<String> clearTable = new HashSet<>(); |
| | | |
| | | |
| | | private String clientUUID; |
| | | |
| | | public void setClearTable(Set<String> clearTable) { |
| | | this.clearTable = clearTable; |
| | | } |
| | | |
| | | public String getClientUUID() { |
| | | return clientUUID; |
| | |
| | | |
| | | public BusinessDataSync(String tricode_funs) { |
| | | this.tricode_funs = tricode_funs; |
| | | this.functionUuid = this.feFunctionCodeByFunctionUuid.get(tricode_funs.trim().replace("mvc", "").replaceAll(",", "")); |
| | | } |
| | | |
| | | public String TSPath = Global.getSystemConfig("new.filePackage", ""); |
| | | |
| | | |
| | | private String functionUuid; |
| | | |
| | | |
| | | public Set<String> getClearAttachment() { |
| | | return clearAttachment; |
| | | } |
| | | |
| | | |
| | | Map<String, String> feFunctionCodeByFunctionUuid = MapUtil |
| | | .builder("035-411-000", "f7c4dd7d-3e17-4f67-b1cb-b36704f3f896")//ä¼è®®å®¤ç³è¯· |
| | | .put("006-009-000", "ed86d09a-23be-4d8c-8cb2-be8622fe50f4")//åå¸å
Œ |
| | | .put("001-006-000", "df981440-327c-4c9f-9395-f98ad067986e")//æ¶æç®¡ç |
| | | .put("001-011-000", "0245268a-8da3-47d5-aab1-4dd85b162904")//èªç±è¡æ |
| | | .put("019-021-000", "8a7c615a-1c4c-4eca-8d83-f04415128267")//åå
¬ç¨åé¢ç¨è¡¨ |
| | | .put("021-012-000", "a3222fac-6203-407b-92c7-3aa2d459c62b")//åæå表å |
| | | .put("021-016-000", "39358718-fe36-44c3-832d-74fae9487922")//å·¥ä½äººååºå·®ï¼å¹è®ï¼å®¡æ¹å |
| | | .put("019-018-000", "243e5c53-72d7-4419-85cf-acc09db68756")//å
¬å¡æ¥å¾
å®¡æ¹ |
| | | .put("019-017-000", "d7e76a76-5650-4499-a941-23faf64ca3c8")//åå
¬å®¤ç¨åéè´å |
| | | .put("001-012-000", "18cbe376-1d7a-4d0c-bd6f-6fd4c5390474")//西å®å¸æ¿äº§ç®¡çå±åæç¨¿çº¸ |
| | | .put("600-008-000", "1d0b60d3-6497-4600-aafb-189ac1c1cdf0")//è¡æ¿å¤ç½äºå
åç¥ä¹¦ |
| | | .put("600-009-000", "9c5b0b79-e801-4a03-a3fa-19974b6c1e67")//è¡æ¿å¤ç½ä¸äº |
| | | .put("600-010-000", "409673e2-bdc3-46f0-adeb-067be4938618")//è¡æ¿å¤ç½å¬è¯åç¥ä¹¦ |
| | | .put("600-011-000", "19fda013-4950-44e9-b276-2ecbdae1fa55")//è¡æ¿å¤ç½å¬è¯éç¥ä¹¦ |
| | | .put("600-012-000", "64876b1a-d13d-492c-a488-2f243a837486")//è¡æ¿å¤ç½ä¸äºå¬è¯éç¥ä¹¦ |
| | | .put("600-013-000", "540a3469-5d6f-41b7-807e-0ac44f46303a")//è¡æ¿å¤ç½å³å®ä¹¦ |
| | | .put("600-014-000", "5509387d-de73-4a66-a42a-fbeff23fd3f0")//è°æ¥ç»ç»æ¥å |
| | | .put("600-015-000", "3c9f9d0a-5a5e-465c-9433-b5541cc7a075")//è¡æ¿æ¡ä»¶ç«æ¡å®¡æ¹è¡¨ |
| | | .put("600-016-000", "8c7c34c5-5dca-4544-a6e4-0fbb7b80eb1f")//è¡æ¿å¤ç½å¬å书 |
| | | .put("019-023-000", "8c9d0806-28ba-43b4-b2cf-dcb81a10ce65")//è¡æ¿æ§æ³å®¡æ¹è¡¨ |
| | | .put("601-001-000", "")//èå¤å½å
¥ |
| | | .put("019-025-000", "30cea2ef-92b1-46c1-8785-5d34755ee803")//åå
¬ç»è´¹ä½¿ç¨å®¡æ¹å |
| | | .put("003-006-000", "6e587365-8ebd-4ab5-bade-dd3b1bf640f8")//åååå
¬ |
| | | .map(); |
| | | |
| | | public Boolean isStr(String str) { |
| | | boolean a = false; |
| | |
| | | throw e; |
| | | } |
| | | String sf28 = Orlfs.getString("sf28"); |
| | | //æ¥è¯¢æ¬ç³»ç»ä¸çåè½uuid |
| | | String feFunctionName = Orlfs.getString("sf02"); |
| | | //SF09 |
| | | String functionId = Orlfs.getString("sf00"); |
| | | |
| | | DataTableEntity dataTable = BaseDaoServiceImpl.getDataTable(conn, "select * from WF_MODEL where WM05=(SELECT SF09 FROM SYS_FACE WHERE SF00 IN (\n" + |
| | | "\n" + |
| | | "select SP04 FROM SYS_PAGE where sp01='001-012-000' and sp04 !='0' and sp04!=' ' GROUP BY SP04\n" + |
| | | ") AND SF09 IS NOT NULL AND LENGTH(SF09)>0 AND SF09!=' ' and ROWNUM=1)", new Object[]{}); |
| | | // if (!DataTableEntity.isEmpty(dataTable)) { |
| | | // String feFlowTitle = dataTable.getString(0, "wm01"); |
| | | // String feTable = dataTable.getString(0, "wm04").split("\\.")[1]; |
| | | // |
| | | // //æ¬ç³»ç»è¡¨å |
| | | // String tableName = this.originalTable.getString(feTable); |
| | | // if (StringUtils.isEmpty(tableName)) { |
| | | // //转æ¢ä¸ºäº§å表å |
| | | // tableName = feTable.toLowerCase(); |
| | | // } |
| | | // FieldSetEntity existFlow = baseDao.getFieldSetEntityByFilter("product_sys_flow_model", "title = ? or table_uuid=?", new Object[]{feFlowTitle, tableName}, false); |
| | | // if (!FieldSetEntity.isEmpty(existFlow)) { |
| | | // //æ¿æµç¨uuidæ¾mvcpage |
| | | // String flowUuid = existFlow.getString("type_code"); |
| | | // FieldSetEntity mvcPage = baseDao.getFieldSetEntityByFilter("product_sys_mvc_page", "flow_uuid = ?", new Object[]{flowUuid}, false); |
| | | // if (!FieldSetEntity.isEmpty(mvcPage)) { |
| | | // functionUuid = mvcPage.getString("function_uuid"); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | //åè½å¦ææªå
³èåºç¡è¡¨ æ¥è¯¢æµç¨è¡¨ |
| | | if (BaseUtil.strIsNull(sf28) || sf28.indexOf(".") == -1) { |
| | | FieldSetEntity modelFse; |
| | |
| | | } catch (Exception e) { |
| | | e.getStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | logger.error("synchronizeTablesData", e); |
| | | } |
| | | |
| | | return sf28; |
| | | } |
| | | |
| | | /** |
| | | * 忥å
¬åè¡¨æ°æ® |
| | | * |
| | | * @param conn |
| | | * @param tableName |
| | | * @throws SQLException |
| | | */ |
| | | private void syncNotice(Connection conn, String tableName) throws SQLException { |
| | | //夿æ¯å¦æ¯å·²ç»åæ¥è¿ç表 |
| | | DataTableEntity dataTable = baseDao.listTable("product_oa_announcement"); |
| | | if (!BaseUtil.dataTableIsEmpty(dataTable)) { |
| | | return; |
| | | } |
| | | DataTableEntity noticeDt = null; |
| | | try { |
| | | noticeDt = BaseDaoServiceImpl.getDataTable(conn, tableName, "", new Object[]{}); |
| | | } catch (Exception e) { |
| | | DataManipulationUtils.close(null, null, conn); |
| | | throw e; |
| | | } |
| | | for (int i = 0; i < noticeDt.getRows(); i++) { |
| | | FieldSetEntity feFs = noticeDt.getFieldSetEntity(i); |
| | | FieldSetEntity fs = new FieldSetEntity(); |
| | | fs.setTableName("product_oa_announcement"); |
| | | fs.setValue("title", feFs.getString("title")); |
| | | fs.setValue("content", feFs.getString("content")); |
| | | fs.setValue("type", feFs.getString("notice_category")); |
| | | fs.setValue("annex", feFs.getString("annex")); |
| | | DataTableEntity accessoryData = new DataTableEntity(); |
| | | FieldSetEntity accessoryFs = new FieldSetEntity("temp"); |
| | | accessoryFs.setValue("si02", "attachment"); |
| | | accessoryFs.setValue("si04", "ANNEX"); |
| | | accessoryData.addFieldSetEntity(accessoryFs); |
| | | if (!BaseUtil.dataTableIsEmpty(accessoryData)) { |
| | | try { |
| | | Map<String, List<String>> stringListMap = this.synchronizationAttachments(conn, accessoryData, fs, "product_oa_announcement", "annex"); |
| | | fs.setValue("annex", CollectionUtil.join(stringListMap.get("annex"), ",")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | //Set 转æ¢ä¸ºå符串éå·åé |
| | | //åæ¹æ³å¤ææ¯å¤äººè¿æ¯é¨é¨ï¼è¥æ¯é¨é¨è½¬æ¢ä¸ºäºº |
| | | fs.setValue("extent", this.getUserIds(conn, feFs.getString("receivers"))); |
| | | fs.setValue("expiration_date", feFs.getDate("displayed_date")); |
| | | fs.setValue("status", feFs.getString("is_reminded")); |
| | | fs.setValue("publish_status", feFs.getString("status")); |
| | | String publisher = this.userIdJson.getString(feFs.getString("publisher")); |
| | | if (BaseUtil.strIsNull(publisher)) { |
| | | continue; |
| | | } |
| | | fs.setValue("created_by", publisher); |
| | | fs.setValue("created_utc_datetime", feFs.getDate("publish_date")); |
| | | |
| | | String uuid = baseDao.add(fs); |
| | | // //éæ°è·åjdbcè¿æ¥ |
| | | // Connection connection = null; |
| | | // try { |
| | | // connection = this.getJDBC(); |
| | | // } catch (ClassNotFoundException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | DataTableEntity subFeFs = getSubDt(conn, "FE_APP5.PUB_NOTICE_RECEIVER", "NOTICE_ID", feFs.getString("id")); |
| | | DataTableEntity subData = new DataTableEntity(); |
| | | FieldMetaEntity f = new FieldMetaEntity(); |
| | | f.setTableName(new String[]{"product_oa_announcement_role"}); |
| | | subData.setMeta(f); |
| | | for (int j = 0; j < subFeFs.getRows(); j++) { |
| | | FieldSetEntity fsSubFe = subFeFs.getFieldSetEntity(j); |
| | | FieldSetEntity fsSub = new FieldSetEntity(); |
| | | fsSub.setTableName("product_oa_announcement_role"); |
| | | String userId = userIdJson.getString(fsSubFe.getString("receiver")); |
| | | if (null == userId) { |
| | | continue; |
| | | } |
| | | //è·åæå±é¨é¨ |
| | | fsSub.setValue("user_id", userId); |
| | | fsSub.setValue("status", fsSubFe.getString("readed")); |
| | | fsSub.setValue("announcement_uuid", uuid); |
| | | subData.addFieldSetEntity(fsSub); |
| | | } |
| | | baseDao.add(subData); |
| | | // DataManipulationUtils.close(null, null, connection); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | throw new BaseException(e.getMessage(), e.toString()); |
| | | } |
| | | return StringUtils.join(extentArr, ","); |
| | | } |
| | | |
| | | /** |
| | | * 忥å
¬åè¡¨æ°æ® |
| | | * |
| | | * @param conn |
| | | * @param tableName |
| | | * @throws SQLException |
| | | */ |
| | | private void syncNotice(Connection conn, String tableName) throws SQLException { |
| | | //夿æ¯å¦æ¯å·²ç»åæ¥è¿ç表 |
| | | DataTableEntity dataTable = baseDao.listTable("product_oa_announcement"); |
| | | if (!BaseUtil.dataTableIsEmpty(dataTable)) { |
| | | return; |
| | | } |
| | | DataTableEntity noticeDt = null; |
| | | try { |
| | | noticeDt = BaseDaoServiceImpl.getDataTable(conn, tableName, "", new Object[]{}); |
| | | } catch (Exception e) { |
| | | DataManipulationUtils.close(null, null, conn); |
| | | throw e; |
| | | } |
| | | for (int i = 0; i < noticeDt.getRows(); i++) { |
| | | FieldSetEntity feFs = noticeDt.getFieldSetEntity(i); |
| | | FieldSetEntity fs = new FieldSetEntity(); |
| | | fs.setTableName("product_oa_announcement"); |
| | | fs.setValue("title", feFs.getString("title")); |
| | | fs.setValue("content", feFs.getString("content")); |
| | | fs.setValue("type", feFs.getString("notice_category")); |
| | | fs.setValue("annex", feFs.getString("annex")); |
| | | DataTableEntity accessoryData = new DataTableEntity(); |
| | | FieldSetEntity accessoryFs = new FieldSetEntity("temp"); |
| | | accessoryFs.setValue("si02", "attachment"); |
| | | accessoryFs.setValue("si04", "ANNEX"); |
| | | accessoryData.addFieldSetEntity(accessoryFs); |
| | | if (!BaseUtil.dataTableIsEmpty(accessoryData)) { |
| | | try { |
| | | Map<String, List<String>> stringListMap = this.synchronizationAttachments(conn, accessoryData, fs, "product_oa_announcement", "annex"); |
| | | fs.setValue("annex", CollectionUtil.join(stringListMap.get("annex"), ",")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | //Set 转æ¢ä¸ºå符串éå·åé |
| | | //åæ¹æ³å¤ææ¯å¤äººè¿æ¯é¨é¨ï¼è¥æ¯é¨é¨è½¬æ¢ä¸ºäºº |
| | | fs.setValue("extent", this.getUserIds(conn, feFs.getString("receivers"))); |
| | | fs.setValue("expiration_date", feFs.getDate("displayed_date")); |
| | | fs.setValue("status", feFs.getString("is_reminded")); |
| | | fs.setValue("publish_status", feFs.getString("status")); |
| | | String publisher = this.userIdJson.getString(feFs.getString("publisher")); |
| | | if (BaseUtil.strIsNull(publisher)) { |
| | | continue; |
| | | } |
| | | fs.setValue("created_by", publisher); |
| | | fs.setValue("created_utc_datetime", feFs.getDate("publish_date")); |
| | | |
| | | String uuid = baseDao.add(fs); |
| | | // //éæ°è·åjdbcè¿æ¥ |
| | | // ConnectionInterface connection = null; |
| | | // try { |
| | | // connection = this.getJDBC(); |
| | | // } catch (ClassNotFoundException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | DataTableEntity subFeFs = getSubDt(conn, "FE_APP5.PUB_NOTICE_RECEIVER", "NOTICE_ID", feFs.getString("id")); |
| | | DataTableEntity subData = new DataTableEntity(); |
| | | FieldMetaEntity f = new FieldMetaEntity(); |
| | | f.setTableName(new String[]{"product_oa_announcement_role"}); |
| | | subData.setMeta(f); |
| | | for (int j = 0; j < subFeFs.getRows(); j++) { |
| | | FieldSetEntity fsSubFe = subFeFs.getFieldSetEntity(j); |
| | | FieldSetEntity fsSub = new FieldSetEntity(); |
| | | fsSub.setTableName("product_oa_announcement_role"); |
| | | String userId = userIdJson.getString(fsSubFe.getString("receiver")); |
| | | if (null == userId) { |
| | | continue; |
| | | } |
| | | //è·åæå±é¨é¨ |
| | | fsSub.setValue("user_id", userId); |
| | | fsSub.setValue("status", fsSubFe.getString("readed")); |
| | | fsSub.setValue("announcement_uuid", uuid); |
| | | subData.addFieldSetEntity(fsSub); |
| | | } |
| | | baseDao.add(subData); |
| | | // DataManipulationUtils.close(null, null, connection); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws SQLException |
| | | */ |
| | | private void syncFunTable(Connection conn, String tableName) throws SQLException { |
| | | private void syncFunTable(Connection conn, String tableName) throws Exception { |
| | | //å
¬å表 |
| | | if (tableName.equals("FE_APP5.PUB_NOTICE")) { |
| | | //两个表建ç«å
³è |
| | | this.originalTable.put("PUB_NOTICE", "product_oa_announcement"); |
| | | syncNotice(conn, tableName); |
| | | //ä¿®æ¹å·²åæ¥éä»¶ æ·»å module_uuid function_uuid |
| | | baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{"036ccacd-47da-4f6e-9cf7-972211717e6e", "ed86d09a-23be-4d8c-8cb2-be8622fe50f4", "product_oa_announcement"}); |
| | | // baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{"036ccacd-47da-4f6e-9cf7-972211717e6e", "ed86d09a-23be-4d8c-8cb2-be8622fe50f4", "product_oa_announcement"}); |
| | | } |
| | | //èå¤è¡¨ é忥å
³èæ°æ®å¦è¯·å表 å¤åºè¡¨ |
| | | if (tableName.equals("FE_APP5.APP_KQLRB")) { |
| | | this.originalTable.put("APP_KQLRB", "product_oa_punch_record"); |
| | | this.originalTable.put("PLEASELEAVE", "product_oa_ask_for_leave"); |
| | | this.originalTable.put("FT_1_WCDJB00", "product_oa_business_trip"); |
| | | |
| | | //忥èå¤ |
| | | this.synchronousClock(conn); |
| | | System.out.println("=================èå¤åæ¥æå==============="); |
| | |
| | | this.syncCcooperates(conn, tableName); |
| | | //å忍¡æ¿æ°æ® |
| | | this.syncCollaborativeTemplate(conn); |
| | | baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{"127c3f55-a7b4-4a77-a097-a65ba95b76f0", "6e587365-8ebd-4ab5-bade-dd3b1bf640f8", "product_oa_cooperates"}); |
| | | |
| | | baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{"127c3f55-a7b4-4a77-a097-a65ba95b76f0", "6e587365-8ebd-4ab5-bade-dd3b1bf640f8", "product_oa_cooperate_flow_node"}); |
| | | |
| | | baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{"127c3f55-a7b4-4a77-a097-a65ba95b76f0", "6e587365-8ebd-4ab5-bade-dd3b1bf640f8", "product_oa_cooperate_flow_reply"}); |
| | | // baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{"127c3f55-a7b4-4a77-a097-a65ba95b76f0", "6e587365-8ebd-4ab5-bade-dd3b1bf640f8", "product_oa_cooperates"}); |
| | | // |
| | | // baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{"127c3f55-a7b4-4a77-a097-a65ba95b76f0", "6e587365-8ebd-4ab5-bade-dd3b1bf640f8", "product_oa_cooperate_flow_node"}); |
| | | // |
| | | // baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{"127c3f55-a7b4-4a77-a097-a65ba95b76f0", "6e587365-8ebd-4ab5-bade-dd3b1bf640f8", "product_oa_cooperate_flow_reply"}); |
| | | System.out.println("=================åååå
¬åæ¥æå==============="); |
| | | } |
| | | //ä¼è®®åæ¥ |
| | |
| | | * @param conn |
| | | * @throws SQLException |
| | | */ |
| | | private void synchronousClock(Connection conn) throws SQLException { |
| | | private void synchronousClock(Connection conn) throws Exception { |
| | | //åæ¥è¯·å PLEASELEAVE |
| | | DataTableEntity pleaseleave = null; |
| | | try { |
| | |
| | | fieldSetEntity.setValue("id", leaveFse.getInteger("pl00")); |
| | | //PL11 请ä¼åå¼å§æ¶é´ fill_in_time å¡«åæ¶é´ |
| | | String pl11 = leaveFse.getString("pl11"); |
| | | fieldSetEntity.setValue("fill_in_time", pl11); |
| | | //PL11 请ä¼åå¼å§æ¶é´ start_time å¼å§æ¶é´ |
| | | if (!StringUtils.isEmpty(pl11)) { |
| | | //夿æ¯å¦ä¸ºæ¥ææ ¼å¼ |
| | | fieldSetEntity.setValue("fill_in_time", DateUtil.parse(pl11).toJdkDate()); |
| | | fieldSetEntity.setValue("start_time", fieldSetEntity.getObject("fill_in_time")); |
| | | } else { |
| | | fieldSetEntity.setValue("fill_in_time", pl11); |
| | | fieldSetEntity.setValue("start_time", pl11); |
| | | } |
| | | fieldSetEntity.setValue("start_time", pl11); |
| | | //PL15 请ä¼åç»ææ¶é´ end_time ç»ææ¶é´ |
| | | String pl15 = leaveFse.getString("pl15"); |
| | |
| | | pl15 = pl11; |
| | | } |
| | | } |
| | | if (!StringUtils.isEmpty(pl15)) { |
| | | //夿æ¯å¦ä¸ºæ¥ææ ¼å¼ |
| | | fieldSetEntity.setValue("fill_in_time", DateUtil.parse(pl15).toJdkDate()); |
| | | } else { |
| | | fieldSetEntity.setValue("end_time", pl15); |
| | | } |
| | | //PL12 请ä¼åå¤©æ° day 请åå¤©æ° |
| | | fieldSetEntity.setValue("day", leaveFse.getString("pl12")); |
| | | //PL09 请ä¼ååå cause 请ååå |
| | |
| | | FieldSetEntity fieldSetEntity = new FieldSetEntity(); |
| | | fieldSetEntity.setTableName("product_oa_ask_for_leave"); |
| | | String f1w08 = fse.getString("f1w08"); |
| | | if (!StringUtils.isEmpty(f1w08)) { |
| | | //夿æ¯å¦ä¸ºæ¥ææ ¼å¼ |
| | | //f1w08 请ä¼åå¼å§æ¶é´ fill_in_time å¡«åæ¶é´ |
| | | fieldSetEntity.setValue("fill_in_time", DateUtil.parse(f1w08).toJdkDate()); |
| | | //f1w08 请ä¼åå¼å§æ¶é´ start_time å¼å§æ¶é´ |
| | | fieldSetEntity.setValue("start_time", fieldSetEntity.getObject("fill_in_time")); |
| | | } else { |
| | | //f1w08 请ä¼åå¼å§æ¶é´ fill_in_time å¡«åæ¶é´ |
| | | fieldSetEntity.setValue("fill_in_time", f1w08); |
| | | //f1w08 请ä¼åå¼å§æ¶é´ start_time å¼å§æ¶é´ |
| | | fieldSetEntity.setValue("start_time", f1w08); |
| | | //f1w09 请ä¼åç»ææ¶é´ end_time ç»ææ¶é´ |
| | | } |
| | | String f1w09 = fse.getString("f1w09"); |
| | | if (!StringUtils.isEmpty(f1w09)) { |
| | | //夿æ¯å¦ä¸ºæ¥ææ ¼å¼ |
| | | fieldSetEntity.setValue("end_time", DateUtil.parse(f1w09).toJdkDate()); |
| | | } else { |
| | | fieldSetEntity.setValue("end_time", fse.getString("f1w09")); |
| | | } |
| | | //day 请ä¼åå¤©æ° day 请åå¤©æ° |
| | | fieldSetEntity.setValue("day", fse.getString("day")); |
| | | //f1w06 请ä¼ååå cause 请ååå |
| | |
| | | * |
| | | * @param clockDt å¤åºdataæ°æ® |
| | | */ |
| | | private void synchronousClock(DataTableEntity clockDt) throws SQLException { |
| | | private void synchronousClock(DataTableEntity clockDt) throws Exception { |
| | | //忥è夿°æ® |
| | | if (!BaseUtil.dataTableIsEmpty(clockDt)) { |
| | | DataTableEntity dataTableEntity = new DataTableEntity(); |
| | |
| | | fieldSetEntity.setValue("time_four_result", fse.getString("xwkqjg")); |
| | | // String xwkqjg = fse.getString("xwkqjg"); |
| | | dataTableEntity.addFieldSetEntity(fieldSetEntity); |
| | | if (dataTableEntity.getRows() == 1000) { |
| | | baseDao.add(dataTableEntity); |
| | | dataTableEntity = new DataTableEntity(); |
| | | dataTableEntity.setMeta(f); |
| | | } |
| | | // if (dataTableEntity.getRows() == 1000) { |
| | | // baseDao.add(dataTableEntity); |
| | | // dataTableEntity = new DataTableEntity(); |
| | | // dataTableEntity.setMeta(f); |
| | | // } |
| | | //请ä¼åæ¾å°è¯·å表éé¢ |
| | | // switch (xwkqjg){ |
| | | // //æ£å¸¸ |
| | |
| | | // } |
| | | } |
| | | if (!BaseUtil.dataTableIsEmpty(dataTableEntity)) { |
| | | baseDao.add(dataTableEntity); |
| | | // baseDao.add(dataTableEntity); |
| | | batchAddData.add(dataTableEntity); |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 忥ååæµç¨æ¶æ¯è¡¨ |
| | | */ |
| | | public void syncCollaborativeNews(DataTableEntity OrlDt, Map<String, String[]> stateMap, String tableName) { |
| | | public void syncCollaborativeNews(DataTableEntity OrlDt, Map<String, String[]> stateMap, String tableName) throws Exception { |
| | | String id = null; |
| | | String message_uuid = null; |
| | | String[] state = null; |
| | |
| | | FieldMetaEntity f = new FieldMetaEntity(); |
| | | f.setTableName(new String[]{"product_sys_message_user"}); |
| | | dataTableEntity.setMeta(f); |
| | | DataTableEntity dt1 = new DataTableEntity(); |
| | | for (int i = 0; i < OrlDt.getRows(); i++) { |
| | | FieldSetEntity fs = OrlDt.getFieldSetEntity(i); |
| | | //æµç¨èç¹id |
| | |
| | | |
| | | //æ¥ç详æ
|
| | | message.setValue("url", state[1]); |
| | | message_uuid = baseDao.add(message); |
| | | dt1.addFieldSetEntity(message); |
| | | message_uuid = UUID.randomUUID().toString(); |
| | | message.setValue("uuid", message_uuid); |
| | | } |
| | | |
| | | FieldSetEntity message_user = new FieldSetEntity(); |
| | |
| | | } |
| | | message_user.setValue("user_id", user_id); |
| | | dataTableEntity.addFieldSetEntity(message_user); |
| | | if (dt1.getRows() > 50000) { |
| | | batchAddData.add(dt1); |
| | | dt1 = new DataTableEntity(); |
| | | } |
| | | baseDao.add(dataTableEntity); |
| | | if (dataTableEntity.getRows() > 50000) { |
| | | batchAddData.add(dataTableEntity); |
| | | dataTableEntity = new DataTableEntity(); |
| | | } |
| | | } |
| | | batchAddData.add(dt1); |
| | | batchAddData.add(dataTableEntity); |
| | | } |
| | | |
| | | /** |
| | |
| | | // fs.setValue("script_method", buttonsFs.getString("se14")); |
| | | //è·¯ç±åç§° |
| | | fs.setValue("route_name", BaseUtil.getPageCode()); |
| | | |
| | | fs.setValue("terminal_type", 1); |
| | | String uuid = baseDao.add(fs); |
| | | //09为éåæé® |
| | | if ("09".equals(buttonsFs.getString("se12")) && !BaseUtil.strIsNull(buttonsFs.getString("se14"))) { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | //ä¿®æ¹å·²åæ¥éä»¶ æ·»å module_uuid function_uuid |
| | | baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{moduleUUID, funUUID, table}); |
| | | // baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{moduleUUID, funUUID, table}); |
| | | String sf05 = funFs.getString("sf05"); |
| | | //è·åjdbcè¿æ¥ |
| | | Connection conn = this.getJDBC(); |
| | |
| | | } |
| | | } |
| | | |
| | | private Set<String> clearAttachment = new HashSet<>(); |
| | | |
| | | /** |
| | | * è¿ç§»ä¸å¡æ°æ®è¡¨ |
| | | * |
| | |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | throw e; |
| | | } |
| | | Map<String, String> map = null; |
| | | Boolean syncAttachments = false; |
| | | Map<String, String> map; |
| | | Boolean syncAttachments; |
| | | DataTableEntity accessoryData; |
| | | //æ¯å¦æ¯æ°è¡¨ |
| | | if (isNew) { |
| | |
| | | this.attachmentValue = this.attachmentValue + accessoryData.getString(i, "si04") + ","; |
| | | } |
| | | this.attachmentValue = "," + this.attachmentValue; |
| | | } else { |
| | | syncAttachments = false; |
| | | } |
| | | //åæ¥è¡¨ç»æ ååæ®µä¿¡æ¯ |
| | | map = this.syncTableField(conn, Orlfs, sf28s, subField); |
| | | //å·æ°table 表 |
| | | // DataPoolCacheImpl.getInstance().cacheDataByTable("product_sys_datamodel_table");; |
| | | //å·æ°field 表 |
| | | // DataPoolCacheImpl.getInstance().cacheDataByTable("product_sys_datamodel_field"); |
| | | // try { |
| | | // Thread.sleep(7000); |
| | | // } catch (InterruptedException e) { |
| | | // e.printStackTrace(); |
| | | // SpringMVCContextHolder.getSystemLogger().error(e); |
| | | // } |
| | | // } else { |
| | | // return; |
| | | // } |
| | | |
| | | //æ¸
ç©ºè¡¨æ°æ® |
| | | String clearTableName = Orlfs.getString("st03").toLowerCase(); |
| | | if (!clearTable.contains(clearTableName)) { |
| | | baseDao.executeUpdate("truncate table " + clearTableName); |
| | | clearTable.add(clearTableName); |
| | | } |
| | | } else { |
| | | map = null; |
| | | syncAttachments = false; |
| | | //å·²æè¡¨ |
| | | this.syncFunTable(conn, sf28s[0] + '.' + sf28s[1]); |
| | | return; |
| | |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | throw e; |
| | | } |
| | | |
| | | //å建10个åºå®çº¿ç¨ |
| | | DataTableEntity dt = new DataTableEntity(); |
| | | //ä¸å¡è¡¨ feçid 对åºUUID |
| | | for (int i = 0; i < dataDt.getRows(); i++) { |
| | | //å°å¾ªç¯ä¸çæ°æ®æ¾å
¥çº¿ç¨æ± |
| | | FieldSetEntity dataFs = dataDt.getFieldSetEntity(i); |
| | | |
| | | try { |
| | | FieldSetEntity tableFs = new FieldSetEntity(); |
| | | tableFs.setTableName(this.originalTable.getString(taName)); |
| | | //key 为æ¬è¡¨å段 value ä¸ºæ°æ®æºå段 |
| | |
| | | } |
| | | } |
| | | if(StringUtils.isEmpty(tableFs.getString(key))){ |
| | | |
| | | tableFs.setValue(key,dataFs.getString(map.get(key))); |
| | | } |
| | | if (tableFs.getTableName().equalsIgnoreCase("sfgl")) { |
| | | tableFs.setValue("is_print", "0"); |
| | | } |
| | | } |
| | | if("bgyplyb".equals(tableFs.getTableName()) && "1208".equals(dataFs.getString("bg00"))){ |
| | |
| | | } |
| | | } |
| | | } |
| | | String uuid = ""; |
| | | String uuid = UUID.randomUUID().toString(); |
| | | try { |
| | | uuid = baseDao.add(tableFs); |
| | | tableFs.setValue("uuid", uuid); |
| | | // uuid = baseDao.add(tableFs); |
| | | if (StringUtils.isEmpty(tableFs.getString("created_by"))) { |
| | | tableFs.setValue("created_by", 1); |
| | | tableFs.setValue("created_utc_datetime", new Date()); |
| | | } |
| | | if ("fwgz".equalsIgnoreCase(tableFs.getTableName())) { |
| | | tableFs.setValue("print_sign", tableFs.getString("fw22")); |
| | | } |
| | | dt.addFieldSetEntity(tableFs); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | logger.error("syncTable", e); |
| | | throw e; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | logger.error("syncTable", e); |
| | | throw e; |
| | | } |
| | | synchronized (pxMap) { |
| | | //表å¯ä¸id 对åºuuid |
| | | pxMap.put(taName + dataFs.getString(this.pk), uuid); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | //æ¹éæå
¥æ°æ® |
| | | batchAddData.add(dt); |
| | | //忥å®ä¸å¼ è¡¨æ°æ®åæ¸
空jsonæ°æ® |
| | | fieldTypeJson.clear(); |
| | | DataTableEntity subTble = null; |
| | |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | throw e; |
| | | } |
| | | try { |
| | | for (int i = 0; i < subTble.getRows(); i++) { |
| | | FieldSetEntity sf = subTble.getFieldSetEntity(i); |
| | | String a[] = {sf.getString("st02"), sf.getString("st03"), taName}; |
| | |
| | | isNew = false; |
| | | } |
| | | this.syncTable(a, isNew, sf.getString("sf01").toLowerCase(), conn); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | logger.error("syncTable", e); |
| | | } |
| | | } |
| | | |
| | |
| | | fieldSetEntity.setMeta(f); |
| | | fieldSetEntity.setValue(field, name); |
| | | fieldSetEntity.setValue("~field_name~", field); |
| | | fieldSetEntity.setValue("function_uuid", this.functionUuid); |
| | | //æ¾å
¥å®¢æ·uuid |
| | | fieldSetEntity.setValue("client_uuid", this.clientUUID); |
| | | rpe.setFiles(fileMap); |
| | |
| | | } catch (Exception e) { |
| | | e.getStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | logger.error("synchronizationAttachments", e); |
| | | } |
| | | } |
| | | } |
| | |
| | | fieldSetEntity.setValue("~field_name~", field); |
| | | //æ¾å
¥å®¢æ·uuid |
| | | fieldSetEntity.setValue("client_uuid", this.clientUUID); |
| | | fieldSetEntity.setValue("function_uuid", this.functionUuid); |
| | | rpe.setFiles(fileMap); |
| | | rpe.setFormData(fieldSetEntity); |
| | | try { |
| | |
| | | } catch (Exception e) { |
| | | DataManipulationUtils.close(null, null, conn); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | e.printStackTrace(); |
| | | throw e; |
| | | } |
| | | if (Orlfs == null) { |
| | |
| | | } catch (Exception e) { |
| | | e.getStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | logger.error("syncModel", e); |
| | | } |
| | | |
| | | } |
| | |
| | | modelFs.setValue("created_by", created_by); |
| | | modelFs.setValue("created_utc_datetime", new Date()); |
| | | String modelUuid = null; |
| | | FieldSetEntity existFlow = baseDao.getFieldSetEntityByFilter("product_sys_flow_model", "title = ?", new Object[]{flowTitle}, false); |
| | | if (!FieldSetEntity.isEmpty(existFlow) && !flag) { |
| | | return existFlow.getString("type_code"); |
| | | } |
| | | FieldSetEntity existFlow = baseDao.getFieldSetEntityByFilter("product_sys_flow_model", "title = ? or table_uuid=?", new Object[]{flowTitle, this.originalTable.getString(wm04s[1])}, false); |
| | | // if (!FieldSetEntity.isEmpty(existFlow) && !flag) { |
| | | // return existFlow.getString("type_code"); |
| | | // } |
| | | try { |
| | | if (!FieldSetEntity.isEmpty(existFlow)) { |
| | | FieldSetEntity mvcPageFse = baseDao.getFieldSetEntityByFilter("product_sys_mvc_page", " flow_uuid = ?", new String[]{wm05}, false); |
| | | typeCode = existFlow.getString("type_code"); |
| | | modelFs = existFlow; |
| | | modelUuid = existFlow.getString("uuid"); |
| | | // functionUuid = mvcPageFse.getString("function_uuid"); |
| | | } else { |
| | | if (modelFs.getString("table_uuid").equalsIgnoreCase("APP_ADMINISTRATIVE_CASES") || modelFs.getString("table_uuid").equalsIgnoreCase("APP_FINAL_SURVEY_REPORT")) { |
| | | modelFs.setValue("module_uuid", "7070362e-6010-4b53-b773-b68b209ad67e"); |
| | | |
| | | } |
| | | modelUuid = baseDao.add(modelFs); |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | logger.error("syncModel", e); |
| | | return typeCode; |
| | | } |
| | | |
| | | FieldSetEntity mvcPageFse = baseDao.getFieldSetEntityByFilter("product_sys_mvc_page", " flow_uuid = ?", new String[]{wm05}, false); |
| | |
| | | this.synchronizingProcessMessages(conn, tricode_funs, stateMap); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | logger.error(e.getMessage(), e); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | } |
| | | } catch (Exception e) { |
| | | e.getStackTrace(); |
| | | logger.error("syncModel", e); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | * @throws SQLException |
| | | */ |
| | | public Map<String, String> syncDetail(String tricode_funs, Connection conn, JSONObject UUIDMap, String tableName, String modelUUID, Map<String, FieldSetEntity> taskFseMap) throws SQLException { |
| | | public Map<String, String> syncDetail(String tricode_funs, Connection conn, JSONObject UUIDMap, String tableName, String modelUUID, Map<String, FieldSetEntity> taskFseMap) throws Exception { |
| | | tableName = tableName.split("\\.")[1]; |
| | | OrgIdUUIDmap = Maps.newHashMap(); |
| | | DataTableEntity OrlDt = null; |
| | |
| | | FieldMetaEntity f = new FieldMetaEntity(); |
| | | f.setTableName(new String[]{"product_sys_flow_detail"}); |
| | | DetailData.setMeta(f); |
| | | DataTableEntity dt = new DataTableEntity(); |
| | | |
| | | for (int i = 0; i < OrlDt.getRows(); i++) { |
| | | FieldSetEntity Orlfs = OrlDt.getFieldSetEntity(i); |
| | | FieldSetEntity DetailFs = new FieldSetEntity(); |
| | |
| | | } |
| | | //å
³èæµç¨ä»»å¡è¡¨ |
| | | DetailFs.setValue("task_uuid", taskFse.getUUID()); |
| | | baseDao.add(DetailFs); |
| | | String uuid = UUID.randomUUID().toString(); |
| | | DetailFs.setValue("uuid", uuid); |
| | | DetailFs.setValue("~type~", "add"); |
| | | // baseDao.add(DetailFs); |
| | | dt.addFieldSetEntity(DetailFs); |
| | | OrgIdUUIDmap.put(wi00, DetailFs); |
| | | stateMap.put(wi00, nodeState); |
| | | } |
| | | batchAddData.add(dt); |
| | | return stateMap; |
| | | } |
| | | |
| | |
| | | * @param stateMap |
| | | * @throws SQLException |
| | | */ |
| | | public void synchronizingProcessMessages(Connection conn, String tricode_funs, Map<String, String> stateMap) throws SQLException { |
| | | public void synchronizingProcessMessages(Connection conn, String tricode_funs, Map<String, String> stateMap) throws Exception { |
| | | try { |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append(" SELECT * FROM FE_BASE5.MESSAGEINFOR WHERE ME14 IN ( ") |
| | |
| | | /** |
| | | * 忥æµç¨æ¶æ¯è¡¨ |
| | | */ |
| | | public void synchronizingProcessMessages(DataTableEntity OrlDt, Map<String, String> stateMap, String tableName) { |
| | | public void synchronizingProcessMessages(DataTableEntity OrlDt, Map<String, String> stateMap, String tableName) throws Exception { |
| | | String id = null; |
| | | String message_uuid = null; |
| | | String state = null; |
| | |
| | | FieldMetaEntity f = new FieldMetaEntity(); |
| | | f.setTableName(new String[]{"product_sys_message"}); |
| | | dataTableEntity.setMeta(f); |
| | | DataTableEntity dt1 = new DataTableEntity(); |
| | | for (int i = 0; i < OrlDt.getRows(); i++) { |
| | | FieldSetEntity fs = OrlDt.getFieldSetEntity(i); |
| | | //æµç¨èç¹id |
| | |
| | | } else if ("2".equals(state)) { |
| | | message.setValue("url", "1621321824686868oKWL726?uuid=" + source_uuid); |
| | | } |
| | | message_uuid = baseDao.add(message); |
| | | message_uuid = UUID.randomUUID().toString(); |
| | | message.setValue("uuid", message_uuid); |
| | | dt1.addFieldSetEntity(message); |
| | | } |
| | | |
| | | FieldSetEntity message_user = new FieldSetEntity(); |
| | |
| | | } |
| | | message_user.setValue("user_id", user_id); |
| | | dataTableEntity.addFieldSetEntity(message_user); |
| | | if (dataTableEntity.getRows() == 1000) { |
| | | baseDao.add(dataTableEntity); |
| | | // if (dataTableEntity.getRows() == 1000) { |
| | | // baseDao.add(dataTableEntity); |
| | | // dataTableEntity = new DataTableEntity(); |
| | | // dataTableEntity.setMeta(f); |
| | | // } |
| | | if (dt1.getRows() > 50000) { |
| | | batchAddData.add(dt1); |
| | | dt1 = new DataTableEntity(); |
| | | } |
| | | if (dataTableEntity.getRows() > 50000) { |
| | | batchAddData.add(dataTableEntity); |
| | | dataTableEntity = new DataTableEntity(); |
| | | dataTableEntity.setMeta(f); |
| | | } |
| | | } |
| | | batchAddData.add(dt1); |
| | | if (!BaseUtil.dataTableIsEmpty(dataTableEntity)) { |
| | | baseDao.add(dataTableEntity); |
| | | batchAddData.add(dataTableEntity); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | * @throws SQLException |
| | | */ |
| | | public Map<String, FieldSetEntity> syncTask(String tricode_funs, Connection conn, String modelUUID) throws SQLException, BaseException { |
| | | public Map<String, FieldSetEntity> syncTask(String tricode_funs, Connection conn, String modelUUID) throws Exception { |
| | | DataTableEntity OrlDt = null; |
| | | try { |
| | | OrlDt = BaseDaoServiceImpl.getDataTable(conn, "fe_base5.WF_TASK", "WT13=(SELECT se16 FROM fe_base5.SYS_EVENT where se01=? and se08 = 1)", new Object[]{tricode_funs |
| | |
| | | throw e; |
| | | } |
| | | Map<String, FieldSetEntity> map = Maps.newHashMap(); |
| | | |
| | | DataTableEntity dt = new DataTableEntity(); |
| | | for (int i = 0; i < OrlDt.getRows(); i++) { |
| | | FieldSetEntity Orlfs = OrlDt.getFieldSetEntity(i); |
| | | FieldSetEntity taskFs = new FieldSetEntity(); |
| | |
| | | taskFs.setValue("record_uuid", record_uuid); |
| | | taskFs.setValue("created_by", id); |
| | | taskFs.setValue("created_utc_datetime", wt09); |
| | | baseDao.add(taskFs); |
| | | taskFs.setValue("uuid", UUID.randomUUID().toString()); |
| | | // baseDao.add(taskFs); |
| | | dt.addFieldSetEntity(taskFs); |
| | | map.put(Orlfs.getString("wt00"), taskFs); |
| | | } |
| | | |
| | | batchAddData.add(dt); |
| | | |
| | | |
| | | return map; |
| | | } |
| | | |
| | |
| | | conn = this.getJDBC(); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | logger.error("run", e); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | } catch (ClassNotFoundException e) { |
| | | e.printStackTrace(); |
| | | logger.error("run", e); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | } |
| | | String moduleUUID = null; |
| | |
| | | //è¡¨åæ¥è¯¢åè½ |
| | | FieldSetEntity fse = baseDao.getFieldSetBySQL("SELECT a.* FROM product_sys_functions a LEFT JOIN product_sys_datamodel_table b on a.table_uuid = b.uuid WHERE b.table_name = ?", new String[]{tableName.toLowerCase()}, false); |
| | | moduleUUID = this.getMoudleByFunctionTricode(fse.getString(CmnConst.TRICODE)); |
| | | String functionUuid = fse.getUUID(); |
| | | //ä¿®æ¹å·²åæ¥éä»¶ æ·»å module_uuid function_uuid |
| | | baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{moduleUUID, functionUuid, tableName.toLowerCase()}); |
| | | //忥æµç¨ |
| | | this.syncFlow(conn, moduleUUID, sf28); |
| | | } |
| | |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | logger.error("run", e); |
| | | } |
| | | } else { |
| | | try { |
| | | //åæ¥è¡¨åè¡¨æ°æ® |
| | | sf28 = this.synchronizeTablesData(conn, this.tricode_funs); |
| | | } catch (SQLException e) { |
| | | logger.error("run", e); |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | } |
| | | String table_name = sf28.split("\\.")[1]; |
| | | String myTableName = this.originalTable.getString(table_name); |
| | | if (!isStr(sf28)) { |
| | | //忥mvc |
| | | try { |
| | | moduleUUID = this.synchronizationModuleName(conn, this.tricode_funs, sf28); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | System.out.println(1); |
| | | } |
| | | } else { |
| | | // if (!isStr(sf28)) { |
| | | // //忥mvc |
| | | // try { |
| | | // moduleUUID = this.synchronizationModuleName(conn, this.tricode_funs, sf28); |
| | | // } catch (SQLException e) { |
| | | // e.printStackTrace(); |
| | | // SpringMVCContextHolder.getSystemLogger().error(e); |
| | | // } |
| | | // } else { |
| | | //å·²æåè½ç表就ä¸åæ¥mvc æ¥è¯¢è¯¥åè½ç模åuuid |
| | | StringBuffer sql = new StringBuffer(); |
| | | sql.append(" tricode = (\n") |
| | |
| | | |
| | | FieldSetEntity fieldSetEntity = baseDao.getFieldSetEntityByFilter("product_sys_functions", sql.toString(), new String[]{myTableName}, false); |
| | | moduleUUID = fieldSetEntity.getUUID(); |
| | | } |
| | | // } |
| | | if (!isStr(sf28)) { |
| | | this.syncFlow(conn, moduleUUID, sf28); |
| | | } |
| | | //è¡¨åæ¥è¯¢åè½ |
| | | FieldSetEntity fse = baseDao.getFieldSetBySQL("SELECT a.* FROM product_sys_functions a LEFT JOIN product_sys_datamodel_table b on a.table_uuid = b.uuid WHERE b.table_name = ?", new String[]{myTableName}, false); |
| | | String functionUuid = fse.getUUID(); |
| | | //ä¿®æ¹å·²åæ¥éä»¶ æ·»å module_uuid function_uuid |
| | | baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{moduleUUID, functionUuid, myTableName}); |
| | | // baseDao.executeUpdate(" UPDATE product_sys_attachments SET module_uuid = ?, function_uuid = ? WHERE attachment_data_table = ? AND function_uuid is null ", new String[]{moduleUUID, functionUuid, myTableName}); |
| | | } |
| | | try { |
| | | DataManipulationUtils.close(null, null, conn); |
| | | } catch (SQLException e) { |
| | | logger.error("run", e); |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | } |
| | |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | logger.error("syncFlow", e); |
| | | } |
| | | //åå§åèåç¼å |
| | | // systemMenusService.initSystemMenu(); |