# AttributeConvertManagerImpl.java

    package com.mycim.server.spec.manager.impl;

    import com.fa.sesa.threadlocal.LocalContext;
    import com.mycim.server.base.manager.NamedObjectManager;
    import com.mycim.server.spec.manager.AttributeConvertManager;
    import com.mycim.server.system.manager.ReferenceFileManager;
    import com.mycim.valueobject.ObjectList;
    import com.mycim.valueobject.consts.ReferenceDetailNames;
    import com.mycim.valueobject.sys.ReferenceFileDetail;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Service;

    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;

    @Service
    public class AttributeConvertManagerImpl implements AttributeConvertManager {

        @Autowired
        NamedObjectManager namedObjectManager;

        @Autowired
        ReferenceFileManager referenceFileManager;

        @Override
        public Map<String, String> getStageIdKeyMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.STAGE_ID,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);

            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);

            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getKey1Value(), referenceFileDetail.getData1Value());
            }

            return result;
        }

        @Override
        public Map<String, String> getStageIdDescKeyMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.STAGE_ID,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);

            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);

            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getData1Value(), referenceFileDetail.getKey1Value());
            }

            return result;
        }

        @Override
        public Map<String, String> getWorkAreaKeyMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.WORK_AREA,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);

            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);

            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getKey1Value(), referenceFileDetail.getData1Value());
            }

            return result;
        }

        @Override
        public Map<String, String> getWorkAreaDescKeyMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.WORK_AREA,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);

            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);

            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getData1Value(), referenceFileDetail.getKey1Value());
            }

            return result;
        }

        @Override
        public Map<String, String> getOperationTypeKeyMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.OPERATION_TYPE,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);

            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);

            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getKey1Value(), referenceFileDetail.getData1Value());
            }

            return result;
        }

        @Override
        public Map<String, String> getOperationTypeDescKeyMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.OPERATION_TYPE,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);

            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);

            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getData1Value(), referenceFileDetail.getKey1Value());
            }

            return result;
        }

        @Override
        public Map<String, String> getBankFlagKeyMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.BANK_FLAG,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);

            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);

            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getKey1Value(), referenceFileDetail.getData1Value());
            }

            return result;
        }

        @Override
        public Map<String, String> getBankFlagDescKeyMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.BANK_FLAG,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);

            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);

            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getData1Value(), referenceFileDetail.getKey1Value());
            }

            return result;
        }

        @Override
        public Map<String, String> getProcessLocationKeyMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.PROCESS_LOCARION_CARRIER_TYPE,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);

            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);

            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getKey1Value(), referenceFileDetail.getData1Value());
            }
            return result;
        }

        @Override
        public Map<String, String> getCarrierTypeKeyMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.PROCESS_LOCARION_CARRIER_TYPE,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);

            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);

            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getData1Value(), referenceFileDetail.getKey1Value());
            }

            return result;
        }

        @Override
        public Map<String, String> getContaminationKeyDescMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.ACCEPT_CONTAMINATION,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);

            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);

            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getKey1Value(), referenceFileDetail.getData1Value());
            }

            return result;
        }

        @Override
        public Map<String, String> getFlipTypeKeyMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.SORTER_FLIP_TYPE,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);
            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);
            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getKey1Value(), referenceFileDetail.getData1Value());
            }
            return result;
        }

        @Override
        public Map<String, String> getFlipTypeValueMap() {
            long referenceFileRrn = namedObjectManager.getNamedObjectRrn(ReferenceDetailNames.SORTER_FLIP_TYPE,
                                                                         LocalContext.getFacilityRrn(),
                                                                         ObjectList.REFERENCE_FILE_KEY);
            List<ReferenceFileDetail> list = referenceFileManager.getReferenceFileDetails(referenceFileRrn);
            Map<String, String> result = new HashMap<>();
            for (ReferenceFileDetail referenceFileDetail : list) {
                result.put(referenceFileDetail.getData1Value(), referenceFileDetail.getKey1Value());
            }
            return result;
        }

    }