package cn.com.goldenwater.dcproj.utils; import cn.com.goldenwater.dcproj.dao.AttAdXBaseDao; import cn.com.goldenwater.dcproj.dto.BisInspPblmImportDto; import cn.com.goldenwater.dcproj.model.AttAdXBase; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AdCodeVerify extends ExcelVerifyParameter{ @Autowired AttAdXBaseDao attAdXBaseDao; @Override public void doverify() throws Exception { collection.VerifyItemList.forEach(a -> { BisInspPblmImportDto obj = a.getObj(); AttAdXBase byCode = attAdXBaseDao.getByCode(obj.getObjAdCode()); if(byCode == null) { a.setTrueOrFalse(false); a.setMsg("行政区划代码不存在"); } }); } }