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.springframework.stereotype.Component;

import java.util.Map;

/**
 * @ClassName : FIRP0167
 * @Description : 联系人姓名一栏如果填入本人姓名，要提示出联系人应非本人，进行演示出来
 * @Author : 胡敬
 * @Date: 2020-03-16 11:02
 */
@Component
public class FIRP0167 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
            String name = firstpageStructureMap.get(Content.name);
            String contactName = firstpageStructureMap.get(Content.contactName);
            if (CatalogueUtil.compareToken(name, contactName)) {
                status.set("-1");
            }
        }
    }
}