34 lines
1.4 KiB
Java
34 lines
1.4 KiB
Java
package com.tenwa.customer.controller.comm;
|
|
|
|
import com.amarsoft.are.jbo.BizObject;
|
|
import com.amarsoft.are.jbo.BizObjectManager;
|
|
import com.amarsoft.are.jbo.JBOFactory;
|
|
import com.amarsoft.are.jbo.JBOTransaction;
|
|
|
|
public class FindCertController {
|
|
private String customerId;
|
|
public String getCustomerId() {
|
|
return customerId;
|
|
}
|
|
public void setCustomerId(String customerId) {
|
|
this.customerId = customerId;
|
|
}
|
|
public String findCert(JBOTransaction tx) throws Exception {
|
|
String certType="";
|
|
String certId="";
|
|
String nationcode="";
|
|
BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.customer.CUSTOMER_CERT.CLASS_NAME);
|
|
BizObjectManager bom2=JBOFactory.getBizObjectManager(jbo.app.tenwa.customer.CUSTOMER_INFO.CLASS_NAME);
|
|
BizObject cert=bom.createQuery("customerId=:customerId and status='valid' and certtype='Ent02'").setParameter("customerId", customerId).getSingleResult(false);
|
|
if(cert!=null){
|
|
certType=cert.getAttribute("certtype").toString();
|
|
certId=cert.getAttribute("certid").toString();
|
|
nationcode=cert.getAttribute("issuecountry").toString();
|
|
bom2.createQuery("update O set certtype=:certtype,certid=:certid,nationcode=:nationcode where customerid=:customerid").setParameter("certtype", certType)
|
|
.setParameter("certid", certId).setParameter("customerid",customerId).setParameter("nationcode", nationcode).executeUpdate();
|
|
}
|
|
|
|
return certType+","+certId;
|
|
}
|
|
}
|