package com.kingdee.shr.base.syssetting.app.io.impl;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.framework.CoreBaseInfo;
import com.kingdee.shr.base.syssetting.app.io.fileImport.BaseImportService;
import com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException;
import com.kingdee.shr.ml.util.SHRServerResource;

/**
 * @Description 组织项目类型导入
 * @Date 2024/5/9 10:07
 * @Created by Heyuan
 */
public class AdminTypeImportFileService extends BaseImportService {

    @Override
    protected void submitData(CoreBaseInfo coreBaseInfo) throws ImportException {
        ImportException importException;
        try {
            coreBaseInfo.put("productionMode", this.getTask().isProductionMode());
            SelectorItemCollection updateSic = new SelectorItemCollection();
            updateSic.add("projectType");
            this.getCoreBase().updatePartial(coreBaseInfo, updateSic);
        } catch (EASBizException var4) {
            importException = new ImportException(var4.getMessage(this.getContext().getLocale()), var4);
            throw importException;
        } catch (BOSException var5) {
            importException = new ImportException(SHRServerResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "save_fails_bos", this.getContext()), var5);
            throw importException;
        } catch (Exception var6) {
            importException = new ImportException(SHRServerResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "save_submit_fails", this.getContext()), var6);
            throw importException;
        }
    }

}
