package com.tuoheng.admin.service.inspection.query.handle;

import com.tuoheng.admin.entity.Dept;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.vo.inspection.InspectionVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service("problemDetailsHandleHandle")
public class ProblemDetailsHandle implements GenerateInspectionFieldHander {

    private GenerateInspectionFieldHander handler;

    @Override
    public void setNextHandler(GenerateInspectionFieldHander handler) {
        this.handler = handler;
    }

    @Override
    public void handler(User user, Dept dept, InspectionVo inspectionVo) {
//        log.info("处理问题详情字段");
        if (!user.getDeptId().equals(inspectionVo.getDeptId())) {
            inspectionVo.setProblemVerify(true);
        }
        if (null != handler) {
            handler.handler(user, dept, inspectionVo);
            return;
        }
    }

}
