package com.vci.server.bof.server.update; import org.apache.commons.lang3.StringUtils; import com.vci.corba.common.data.VCIInvocationInfo; import com.vci.corba.omd.data.BusinessObject; import com.vci.server.base.persistence.dao.HibernateSessionFactory; import com.vci.server.base.utility.LogRecordUtil; import com.vci.server.bof.server.ServiceFacadeExecuteHelper; import com.vci.server.bof.service.BOFactoryServices; public class ChangeBOOwner extends ServiceFacadeExecuteHelper{ private static ServiceFacadeExecuteHelper instance = null; public static ServiceFacadeExecuteHelper getInstance() { if(instance == null) { instance = new ChangeBOOwner(); } return instance; } @Override protected Object doAction() throws Throwable { boolean rs = false; BusinessObject bo = params.getBo(); try { BOFactoryServices services = BOFactoryServices.getInstance(); rs = services.changeBusinessObjectOwner(bo, params.getUserInfo()); if (!rs) { return rs; } //日志记录 VCIInvocationInfo info = HibernateSessionFactory.getVciSessionInfo(); String ip = "127.0.0.1"; if(info!=null){ ip = info.clientIPInfo == null||"".equals(info.clientIPInfo) ?"127.0.0.1":info.clientIPInfo; } String logInfo = StringUtils.isNotBlank(bo.name)?bo.name:(StringUtils.isNotBlank(bo.id)?bo.id:bo.oid); //recordLog(bo.modifier, bo.btName, ip, "变更所有者", bo.btName, logInfo, bo.oid); LogRecordUtil.writeGeneralSuccessLog(bo, "变更所有者"); } catch (Exception e) { e.printStackTrace(); throw this.getLocalString("P0010SOF-00009", e); } catch (Throwable t) { t.printStackTrace(); throw this.getLocalString("P0010SOF-00009", t); } return rs; } }