田源
2024-03-07 4b4083fd73dc27ece42f4835483565eef0e4f608
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.vci.server.bof.server.create;
 
 
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.bof.server.ServiceFacadeExecuteHelper;
import com.vci.server.bof.service.BOFactoryServices;
import com.vci.corba.common.VCIError;
 
public class BatchCreateBO extends ServiceFacadeExecuteHelper{
 
    private static ServiceFacadeExecuteHelper instance = null;
    
    public static ServiceFacadeExecuteHelper getInstance() {
        if(instance == null) {
            instance = new BatchCreateBO();
        }
        return instance;
    }
 
    @Override
    protected Object doAction() throws Throwable {
        try {
            BOFactoryServices services = BOFactoryServices.getInstance();
            BusinessObject[] currentBOs = services.batchCreateBusinessObject(params.getBos(), params.isRevision(), params.isNewVersion());
            //日志记录
            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;
            }
            batchRecordLog(currentBOs, ip, "创建");
            
            return currentBOs;
        } catch (VCIError e) {
            throw super.getLocalString(e.code, e);
        } catch (Exception e) {
            //e.printStackTrace();
            //ServerWithLog4j.logger.error(e);
            
            throw this.getLocalString("P0010SOF-00001", e);
        } catch (Throwable t) {
            
            //t.printStackTrace();
            throw this.getLocalString("P0010SOF-00001", t);
        }
    }
 
}