档案信息导入后更新合同id
This commit is contained in:
parent
2933aaec99
commit
558df0f188
@ -67,7 +67,13 @@
|
||||
var sparam=JSON.stringify(importCondition).replace(/,/g,"@");//生成模板的参数据
|
||||
AsDialog.PopView("/Tenwa/Core/OfficeTemplate/TemplateManager/BFTemplateTest/uploadExcel.jsp","importparam="+sparam,
|
||||
{width:"350px",height:"40px",title:"上传文件下载数据"},function(){
|
||||
reloadSelf();});
|
||||
updateContractId();
|
||||
});
|
||||
}
|
||||
//更新对应的contractid
|
||||
function updateContractId(){
|
||||
RunJavaMethodSqlca("com.tenwa.lease.function.ImportContractId","updateContractId","");
|
||||
reloadSelf();
|
||||
}
|
||||
//模板下载
|
||||
function DiscountDownload(){
|
||||
|
||||
@ -49,7 +49,7 @@ public class MailingContainerNumberImport extends BaseImportExcelCallBack{
|
||||
|
||||
// 通过本次excel中的数据是否在系统中
|
||||
//sql1="SELECT ARCHIVING_CABINET_NO,CONTRACT_NUMBER FROM LB_FILE_ARCHIVING_INFO WHERE ARCHIVING_CABINET_NO='"+CONTRACT_NUMBER+"'";
|
||||
sql1="select id from lb_contract_info where contract_no='"+CONTRACT_NUMBER+"'";
|
||||
sql1="select id from lb_contract_info where contract_status>=31 and contract_status<100 and contract_no='"+CONTRACT_NUMBER+"'";
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(Sqlca, sql1, null);
|
||||
// 无结果,说明不在系统中
|
||||
if(dataList.size()<=0){
|
||||
|
||||
32
src_tenwa/com/tenwa/lease/function/ImportContractId.java
Normal file
32
src_tenwa/com/tenwa/lease/function/ImportContractId.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.tenwa.lease.function;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.omg.CORBA.Object;
|
||||
|
||||
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
|
||||
import jbo.com.tenwa.lease.comm.LB_FILE_ARCHIVING_INFO;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
|
||||
public class ImportContractId {
|
||||
|
||||
public void updateContractId(Transaction Sqlca ) throws Exception{
|
||||
BizObjectManager lfaiManage=JBOFactory.getBizObjectManager(LB_FILE_ARCHIVING_INFO.CLASS_NAME,Sqlca);
|
||||
BizObjectManager lciManage=JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME,Sqlca);
|
||||
List<BizObject> lfais = lfaiManage.createQuery(" (contract_id is null) and (contract_number is not null) ").getResultList(true);
|
||||
for (int i=0;i<lfais.size();i++){
|
||||
BizObject lfai = lfais.get(i);
|
||||
if(lfai !=null ){
|
||||
BizObject lci = lciManage.createQuery(" contract_no=:contract_no ").setParameter("contract_no", lfai.getAttribute("contract_number")==null?"":lfai.getAttribute("contract_number").getString()).getSingleResult(false);
|
||||
lfai.setAttributeValue("contract_id", lci==null?"":lci.getAttribute("id").toString());
|
||||
lfaiManage.saveObject(lfai);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user