package com.lantone.qc.kernel.catalogue.firstpagerecord;

import com.lantone.qc.kernel.catalogue.QCCatalogue;
import com.lantone.qc.kernel.util.CatalogueUtil;
import com.lantone.qc.pub.Content;
import com.lantone.qc.pub.model.InputInfo;
import com.lantone.qc.pub.model.OutputInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @ClassName : FIRP0170
 * @Description :转科科别未填写
 * @Author : 胡敬
 * @Date: 2020-03-16 11:33
 */
@Component
public class FIRP0170 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getFirstPageRecordDoc() == null){
            return;
        }
        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
            String transferDept = firstpageStructureMap.get(Content.transferDept);
            if (StringUtils.isEmpty(transferDept) || "【转科科室】".equals(transferDept)){
                status.set("-1");
            }
        }
    }
}