接口平台

This commit is contained in:
lixuebo 2019-08-20 15:32:19 +08:00
parent ddb10c2559
commit 9219acaed1

View File

@ -20,21 +20,17 @@ import com.tenwa.reckon.bean.TabCalBean;
import com.tenwa.reckon.constant.Scale;
public class ConditionHelper {
private static ConditionHelper help;
private JBOTransaction tx;
private ConditionHelper(JBOTransaction tx){
this.tx=tx;
public JBOTransaction getTx() {
return tx;
}
public static ConditionHelper getInstance(JBOTransaction tx){
if(help == null){
help = new ConditionHelper(tx);
}
return help;
public void setTx(JBOTransaction tx) {
this.tx = tx;
}
public void run(JSONObject jsonObject,ConditionBean cb,TabCalBean bean,FundRentPlanBean rentPlan,Boolean flag) throws Exception{
Map<String, String> params = this.runPre(jsonObject,cb, bean, rentPlan,flag);
jsonObject.appendElement("info",params);
@ -210,21 +206,11 @@ public class ConditionHelper {
private void updateCondition(TabCalBean tcb,Map<String, String> params) throws Exception {
BizObjectManager bm=JBOFactory.getBizObjectManager(tcb.getCondition_tb());
BizObjectManager bm=JBOFactory.getBizObjectManager(tcb.getCondition_tb(), tx);
BizObject condition=bm.createQuery("flowunid=:flowunid and "+tcb.getPlanCName()+"=:value").setParameter("flowunid", tcb.getDocId()).setParameter("value", tcb.getPlanCValue()).getSingleResult(true);
for(Map.Entry<String,String> entry:params.entrySet()){
condition.setAttributeValue(entry.getKey(), entry.getValue());
}
bm.saveObject(condition);
}
public JBOTransaction getTx() {
return tx;
}
public void setTx(JBOTransaction tx) {
this.tx = tx;
}
}