package com.dxhy.jxpt.baseService.sign.service.qsgz.impl;

import com.dxhy.api.model.config.UserInfo;
import com.dxhy.common.enums.FplxEnum;
import com.dxhy.api.model.invoice.TDxRecordInvoice;
import com.dxhy.jxpt.baseService.sign.service.qsgz.RulesService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

@Slf4j
@Service("1001")
public class Rules1001ServiceImpl implements RulesService {
    @Override
    public String validationRules(UserInfo userInfo, String qsType, Map<String, String> pramsMap, TDxRecordInvoice recordInvoice, String invoiceType) {

        if (FplxEnum.ZP.getFplxDm().equals(invoiceType) || FplxEnum.TXF.getFplxDm().equals(invoiceType)
                || FplxEnum.JDC.getFplxDm().equals(invoiceType)
                || FplxEnum.DZZP.getFplxDm().equals(invoiceType)
                || FplxEnum.QDZZP.getFplxDm().equals(invoiceType)
                || FplxEnum.ZZDZ.getFplxDm().equals(invoiceType)
                || FplxEnum.SDFP_JDCTYXSFP.getFplxDm().equals(invoiceType)|| FplxEnum.ZZJDC.getFplxDm().equals(invoiceType)|| FplxEnum.ESCDZ.getFplxDm().equals(invoiceType)|| FplxEnum.ZZESC.getFplxDm().equals(invoiceType)
        ) {
            if (recordInvoice == null) {
                return "无底账信息，签收失败!";
            }
        }
        return "";
    }

    @Override
    public String getEdiType() {
        return "1001";
    }
}
