AX_DataSource

for (custInvoiceJourLocal = custInvoiceJour_ds.getFirst(true) ? custInvoiceJour_ds.getFirst(true) : custInvoiceJour; 
     custInvoiceJourLocal; 
     custInvoiceJourLocal = custInvoiceJour_ds.getNext()) 
{ 
    info(custInvoiceJourLocal.recid); 
custInvoiceJourLocal.reread();   } 
custInvoiceJour_ds.reread();
custInvoiceJour_ds.refresh();

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    AifService service = element.args().record();  aifAction_DS.query().dataSourceTable(tablenum(AifAction)).addRange(fieldnum(AifAction,ClassId)).value(int2str(service.ClassId));    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    assetBookTable_ds.object(fieldnum(AssetBookTable, WorkingDays_IN)).visible(false);    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    if (element.args().dataset() != tablenum(BankCodaTrans))  {      throw error("@SYS22996");  }    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    Init methods  Query                   q new Query();  QueryBuildDataSource    qB;  ;    qB = q.addDataSource(tablenum(BOMCalcTable));  qB.addRange(fieldnum(BOMCalcTable,ItemId)).value(queryValue(bomDesignerBOMCalc.parmItemId()));  this.query(q);    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    this.query().dataSourceNo(1).addSortField(fieldnum(BOMCalcTable,PriceCalcId),SortOrder::Ascending);    this.query().dataSourceTable(tablenum(ExciseRG23ARegister_IN)).addSelectionField(fieldnum(ExciseRG23ARegister_IN, rg23aRecoverable), SelectionField::Sum);    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    custInvoiceJourLocal  object fieldNameRef;  ;  fieldNumRef = tableName_ds.object(fieldNum(tableName,fieldName));  fieldNumRef.methodName();    THK_InventAFormLine.dataSource().reread();  THK_InventAFormLine.dataSource().refresh();  THK_InventAFormLine.dataSource().active();    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////      multiselectionHelper    _multiselectionHelper;  THK_InventAFormLine     inventAFormLine;  ;  _multiselectionHelper = multiselectionHelper::createFromCaller(element);  for(inventAFormLine  = _multiselectionHelper.getFirst();      inventAFormLine;      inventAFormLine  =  _multiselectionHelper.getNext())  {      tmpAFLineTable.clear();      tmpAFLineTable.THK_InventAFormId  = inventAFormLine.THK_InventAFormId;      tmpAFLineTable.LineNum            = inventAFormLine.LineNum;      tmpAFLineTable.insert();  }    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    THK_ProdPMCInquiryDataUpdate_new     THK_ProdPMCInquiryUpate new THK_ProdPMCInquiryDataUpdate_new();  Queryrun                            localQueryrun;  THK_PMCInquiryTable_Prod            localPMCInquiryTable_Prod;  ProdTable                           localProdTable;  ;    super();    //THK_ProdPMCInquiryUpate.refreshProdTable(THK_PMCInquiryTable_Prod_ds.queryRun().query());  localQueryrun = new SysQueryRun(THK_PMCInquiryTable_Prod_ds.queryRun().query());  while (localQueryrun.next())  {      if (localQueryrun.changed(tableNum(THK_PMCInquiryTable_Prod)))      {          localPMCInquiryTable_Prod = localQueryrun.get(tableNum(THK_PMCInquiryTable_Prod));          //localProdTable = ProdTable::find(localPMCInquiryTable_Prod.ProdTable_ProdId);          // <junwa> VAR-Modification on 23 四月 2013 at 11:06:58 by KTL junwa - Begin          changecompany(localPMCInquiryTable_Prod.SourceDataAreaId)          {              localProdTable = ProdTable::find(localPMCInquiryTable_Prod.ProdTable_ProdId);              THK_ProdPMCInquiryUpate.updateProdTable(localProdTable);          }          // </junwa> VAR-Modification on 23 四月 2013 at 11:06:58 by KTL junwa - End      }  }    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    THK_PMCInquiryTable_Prod_ds.research();  THK_PMCInquiryTable_Prod_ds.refresh();  THK_PMCInquiryTable_Prod_ds.active();    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    formRun = element.args().caller();  for(intDsCount =1 ;intDsCount<= formRun.dataSourceCount();intDsCount++)  {      i++;      if(formRun.dataSource(intDsCount).name() == tableStr(QuotLine))      {          fdsSalesQuotationLine = formRun.dataSource(intDsCount);          fdsSalesQuotationLine.executeQuery();      }  }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

转载于:https://www.cnblogs.com/zoao/p/6762259.html

package com.hw.camunda.config.datasource; import com.baomidou.dynamic.datasource.creator.DataSourceProperty; import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; import java.util.HashMap; import java.util.Map; @Configuration public class DataSourceDecryptConfig { @Autowired private Environment env; @Bean public DynamicDataSourceProperties dynamicDataSourceProperties() { DynamicDataSourceProperties properties = new DynamicDataSourceProperties(); // 获取并解密主数据源 DataSourceProperty primary = decryptDataSource("spring.datasource.dynamic.primary"); properties.setPrimary(primary.getName()); // 解密所有数据源 Map<String, DataSourceProperty> dataSources = new HashMap<>(); dataSources.put("master", decryptDataSource("spring.datasource.dynamic.datasource.master")); dataSources.put("slave", decryptDataSource("spring.datasource.dynamic.datasource.slave")); properties.setDatasource(dataSources); return properties; } private DataSourceProperty decryptDataSource(String prefix) { DataSourceProperty dsProp = new DataSourceProperty(); dsProp.setUrl(decrypt(env.getProperty(prefix + ".url"))); dsProp.setUsername(decrypt(env.getProperty(prefix + ".username"))); dsProp.setPassword(decrypt(env.getProperty(prefix + ".password"))); return dsProp; } private String decrypt(String encryptedText) { // 调用你的解密工具 (示例: Jasypt) return EncryptUtil.decrypt(encryptedText); } } 有问题,我也不知道我的yml会有几个数据源,所以能不能帮我改为全部动态的
08-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值