74 lines
3.1 KiB
Java
74 lines
3.1 KiB
Java
package com.tenwa.flow;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
import jbo.app.tenwa.customer.DISTRIBUTOR_INFO;
|
|
import jbo.app.tenwa.customer.DISTRIBUTOR_INFO_TEMP;
|
|
|
|
import com.amarsoft.app.util.ASOrgObject;
|
|
import com.amarsoft.are.jbo.BizObject;
|
|
import com.amarsoft.are.jbo.BizObjectManager;
|
|
import com.amarsoft.are.jbo.JBOFactory;
|
|
import com.amarsoft.are.util.StringFunction;
|
|
import com.amarsoft.awe.util.Transaction;
|
|
import com.amarsoft.context.ASUser;
|
|
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
|
import com.tenwa.flow.baseBussion.BaseBussiness;
|
|
import com.tenwa.lease.flow.project.businessapply.DistributorCompare;
|
|
|
|
public class CopyInfoTempToFormal extends BaseBussiness{
|
|
|
|
@Override
|
|
public Object run(Transaction Sqlca) throws Exception {
|
|
this.initBussinessParam(Sqlca);
|
|
Map<String,String>fromCondtion=new HashMap<String, String>();
|
|
|
|
fromCondtion.put("flowunid",this.getAttribute("FlowUnid").toString());
|
|
BizObject dst= DataOperatorUtil.getSingleJBO(DISTRIBUTOR_INFO_TEMP.CLASS_NAME, fromCondtion, Sqlca);
|
|
String distributor_no=dst.getAttribute("distributor_no").getString();
|
|
fromCondtion.clear();
|
|
fromCondtion.put("distributor_no", distributor_no);
|
|
BizObject disinfo= DataOperatorUtil.getSingleJBO(DISTRIBUTOR_INFO.CLASS_NAME, fromCondtion, Sqlca);
|
|
String disStatus = dst.getAttribute("distributor_status").toString();
|
|
BizObjectManager ditinfo = JBOFactory.getBizObjectManager(DISTRIBUTOR_INFO.CLASS_NAME,Sqlca);
|
|
if("distributor_status08".equals(disStatus)){
|
|
disinfo.setAttributeValue("distributor_status", "distributor_status09");
|
|
}
|
|
ditinfo.saveObject(disinfo);
|
|
String sMessage="true";
|
|
return sMessage;
|
|
}
|
|
/**
|
|
* 保存渠道信息
|
|
* @author 2018-06-10
|
|
*/
|
|
/*private String saveOrgInfo(Transaction Sqlca) throws Exception {
|
|
ASOrgObject orgObject= new ASOrgObject("8006");//默认为安鹏向下的渠道信息
|
|
Map<String,String> mapOrgInfo=orgObject.nextLevalOrgNo(Sqlca);
|
|
BizObjectManager manager = JBOFactory.getFactory().getManager("jbo.sys.ORG_INFO");
|
|
BizObject bo=null;
|
|
BizObjectManager PM=JBOFactory.getBizObjectManager(DISTRIBUTOR_INFO_TEMP.CLASS_NAME);
|
|
BizObject partnerInfo=PM.createQuery(" select * from O where O.flowUnid=:flowUnid").setParameter("flowUnid", this.getAttribute("FlowUnid").toString()).getSingleResult(true);
|
|
if(!mapOrgInfo.isEmpty()){
|
|
ASUser asUser=new ASUser(this.getAttribute("CurUserID").toString());
|
|
bo=manager.newObject();
|
|
bo.setAttributeValue("ORGID", mapOrgInfo.get("orgno"));
|
|
bo.setAttributeValue("SORTNO", mapOrgInfo.get("sortno"));
|
|
bo.setAttributeValue("TREESORTNO", mapOrgInfo.get("sortno"));
|
|
bo.setAttributeValue("ORGLEVEL", "9");//默认渠道
|
|
bo.setAttributeValue("STATUS", "1");//默认启用
|
|
if(partnerInfo!=null){
|
|
bo.setAttributeValue("RELATIVEORGID", "8006");
|
|
bo.setAttributeValue("BELONGORGID", "8006");
|
|
bo.setAttributeValue("ORGNAME", partnerInfo.getAttribute("distributor_name").toString());
|
|
bo.setAttributeValue("INPUTORG", asUser.getOrgID());
|
|
bo.setAttributeValue("InputUser", asUser.getUserID());
|
|
bo.setAttributeValue("InputTime", StringFunction.getTodayNow());
|
|
}
|
|
manager.saveObject(bo);
|
|
}
|
|
return bo.getAttribute("ORGID").toString();
|
|
}*/
|
|
}
|