|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.excel.context.AnalysisContext; | 
|---|
|  |  |  | import com.alibaba.excel.event.AnalysisEventListener; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.mapper.EntityWrapper; | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.common.SpringUtils; | 
|---|
|  |  |  | import com.core.exception.CoolException; | 
|---|
|  |  |  | 
|---|
|  |  |  | mat = excel; | 
|---|
|  |  |  | mat.setTagId(tagId); | 
|---|
|  |  |  | if (!matService.insert(mat)) { | 
|---|
|  |  |  | throw new CoolException("保存商品信息失败,单据号:" + excel.getMatnr()); | 
|---|
|  |  |  | throw new CoolException("保存商品信息失败,物料号:" + excel.getMatnr()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | total++; | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | mat = excel; | 
|---|
|  |  |  | mat.setTagId(tagId); | 
|---|
|  |  |  | matService.update(mat,new EntityWrapper<Mat>().eq("matnr",mat.getMatnr())); | 
|---|
|  |  |  | total++; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|