# LotRunCardQueryServiceImpl.java

    package com.mycim.server.wip.service;

    import com.alipay.sofa.runtime.api.annotation.SofaService;
    import com.alipay.sofa.runtime.api.annotation.SofaServiceBinding;
    import com.fa.sesa.threadlocal.LocalContext;
    import com.mycim.framework.jdbc.Page;
    import com.mycim.framework.utils.beans.BeanUtils;
    import com.mycim.framework.utils.lang.StringUtils;
    import com.mycim.framework.utils.lang.collections.MapUtils;
    import com.mycim.framework.utils.lang.math.NumberUtils;
    import com.mycim.framework.utils.lang.time.DateUtils;
    import com.mycim.server.wip.manager.LotQueryManager;
    import com.mycim.server.wip.manager.RunCardQueryManager;
    import com.mycim.utils.WipUtils;
    import com.mycim.valueobject.runcard.dto.RunCardPortalQueryDTO;
    import com.mycim.valueobject.wip.*;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Service;

    import java.util.List;
    import java.util.Map;
    import java.util.Objects;

    /**
     * @author finatice.yang
     * @date 2021/4/30
     **/
    @Service
    @SofaService(interfaceType = LotRunCardQueryService.class, bindings = {@SofaServiceBinding(bindingType = "bolt")})
    public class LotRunCardQueryServiceImpl implements LotRunCardQueryService {

        @Autowired
        private RunCardQueryManager runCardQueryManager;

        @Autowired
        private LotQueryManager lotQueryManager;

        @Override
        public LotRunCard getLotRunCardByMainLot(Long lotRrn) {
            return runCardQueryManager.getLotRunCardByMainLot(lotRrn);
        }

        @Override
        public LotRunCard getLotRunCard(long runCardRrn) {
            return runCardQueryManager.getLotRunCard(runCardRrn);
        }

        @Override
        public Boolean checkLotInRunCard(Long lotRrn) {
            if (Objects.nonNull(runCardQueryManager.getLotRunCardByMainLot(lotRrn))) {
                return Boolean.TRUE;
            }
            if (Objects.nonNull(runCardQueryManager.getSplitRunCardLotStore(lotRrn))) {
                return Boolean.TRUE;
            }
            return Boolean.FALSE;
        }

        @Override
        public LotRecoveryRunCard getLotRecoveryRunCard(Long runCardRrn) {
            return runCardQueryManager.getLotRecoveryRunCard(runCardRrn);
        }

        @Override
        public List<LotRunCard> getEffectiveLotRuncardByLot(long lotRrn) {
            return runCardQueryManager.getEffectiveLotRuncardByLot(lotRrn);
        }

        @Override
        public LotRunCardStore getSplitRunCardLotStore(long lotRrn, long runcardRrn) {
            return runCardQueryManager.getSplitRunCardLotStore(lotRrn, runcardRrn);
        }

        @Override
        public LotRunCardStore getSplitRunCardLotStore(long lotRrn) {
            return runCardQueryManager.getSplitRunCardLotStore(lotRrn);
        }

        @Override
        public List<Map<String, Object>> getRunCardLotsByRuncardRrn(Long runcardRrn) {
            return runCardQueryManager.getRunCardLotsByRuncardRrn(runcardRrn);
        }

        @Override
        public SRCLotSpecialStep getLotSplitRunCardSpecialStep(Long lotSpecialStepRrn, Integer stepSeq) {
            return runCardQueryManager.getLotSplitRunCardSpecialStep(lotSpecialStepRrn, stepSeq);
        }

        @Override
        public SRCLotSpecialStep getLotSplitRunCardSpecialStep(Long lotRrn) {
            return runCardQueryManager.getLotSplitRunCardSpecialStep(lotRrn);
        }

        @Override
        public LotRunCard getOuterInfo(long lotRrn) {
            return runCardQueryManager.getOuterInfo(lotRrn);
        }

        @Override
        public LotRunCard getLotSplitRunCardSetByLot(String lotId) {
            return runCardQueryManager.getLotSplitRunCardSetByLot(lotId);
        }

        @Override
        public List<Map<String, Object>> getSplitedRunCardLots(long runcardRrn) {
            return runCardQueryManager.getSplitedRunCardLots(runcardRrn);
        }

        @Override
        public List<Map<String, Object>> qrySplitRunCardLotInfo(Map<String, Object> lotPortalFormMap, String rowStart,
                                                                String pageSize) {
            return runCardQueryManager
                    .qrySplitRunCardLotInfo(lotPortalFormMap, LocalContext.getFacilityRrn(), rowStart, pageSize);
        }

        @Override
        public Map<String, Object> getRCLotInfoMap(String lotId) {
            return runCardQueryManager.getRCLotInfoMap(lotId);
        }

        @Override
        public RunCardLotInfo getRunCardLotInfo(String lotId) {
            return runCardQueryManager.getRunCardLotInfo(lotId);
        }

        @Override
        public Map<String, Object> getRCLotStepInfo(String lotId, Long runCardRrn) {
            return runCardQueryManager.getRCLotStepInfo(lotId, runCardRrn);
        }

        @Override
        public int getRCChildLotCount(String lotId, String runCardIdPrefix) {
            return runCardQueryManager.getRCChildLotCount(lotId, runCardIdPrefix);
        }

        @Override
        public Page qryRuncardLotTransHistory(Page page, Long lotRrn) {
            return runCardQueryManager.qryRuncardLotTransHistory(page, lotRrn);
        }

        @Override
        public List<Map<String, Object>> qryRuncardLotTransHistory(Map<String, Object> condition, int thisPage,
                                                                   int pageSize) {
            return runCardQueryManager.qryRuncardLotTransHistory(condition, thisPage, pageSize);
        }

        @Override
        public String getRCRunCardIdByLotId(String lotId) {
            return runCardQueryManager.getRCRunCardIdByLotId(lotId);
        }

        @Override
        public List getSumbitAndActiveRunCardCreateTime(Long lotRrn) {
            return runCardQueryManager.getSumbitAndActiveRunCardCreateTime(lotRrn);
        }

        @Override
        public List<Map<String, Object>> queryFecthStepBySrc(long lotRrn) {
            return runCardQueryManager.queryFecthStepBySrc(lotRrn);
        }

        @Override
        public List<LotRunCardSplit> getLotRunCardSplit(Long runcardRrn) {
            return runCardQueryManager.getLotRunCardSplit(runcardRrn);
        }

        @Override
        public List<LotRunCardStep> getLotRunCardStepList(Long runCardRrn) {
            return runCardQueryManager.getLotRunCardStepList(runCardRrn);
        }

        @Override
        public List<LotRunCardStep> getLotRunCardStepList(Long runCardRrn, Integer splitSeq) {
            return runCardQueryManager.getLotRunCardStepList(runCardRrn, splitSeq);
        }

        @Override
        public List<Map<String, Object>> getRunCardGridInfo(String lotId) {
            return runCardQueryManager.getRunCardGridInfo(lotId);
        }

        @Override
        public List<LotRunCardStepParameter> getLotRunCardStepParameterList(Long runCardRrn, Integer stepSerialNo,
                                                                            Long parameterSetRrn) {
            return runCardQueryManager.getLotRunCardStepParameterList(runCardRrn, stepSerialNo, parameterSetRrn);
        }

    }