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

import com.dxhy.common.enums.FplxEnum;
import com.dxhy.common.vo.UserInfo;
import com.dxhy.sign.entity.TDxRecordInvoice;
import com.dxhy.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)) {
            if (recordInvoice == null) {
                return "无底账信息，签收失败!";
            }
        }
        return "";
    }

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