|
@ -73,6 +73,8 @@ public class GdInstorageService extends ServiceImpl<GdInstorageMapper, GdInstora |
|
|
@Autowired |
|
|
@Autowired |
|
|
private GdInstorageLogService gdInstorageLogService; |
|
|
private GdInstorageLogService gdInstorageLogService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
|
|
|
private GdInstorageLogErrService gdInstorageLogErrService; |
|
|
|
|
|
@Autowired |
|
|
private SupplierIndexService supplierIndexService; |
|
|
private SupplierIndexService supplierIndexService; |
|
|
|
|
|
|
|
|
public void doimp(String filePath) { |
|
|
public void doimp(String filePath) { |
|
@ -148,8 +150,8 @@ public class GdInstorageService extends ServiceImpl<GdInstorageMapper, GdInstora |
|
|
private RowHandler createRowHandler(GdInstorageLog gdlog) { |
|
|
private RowHandler createRowHandler(GdInstorageLog gdlog) { |
|
|
return new RowHandler() { |
|
|
return new RowHandler() { |
|
|
|
|
|
|
|
|
List<GdInstorageGd> toInsertListGd = new ArrayList<>(); |
|
|
private List<GdInstorageGd> toInsertListGd = new ArrayList<>(); |
|
|
List<GdInstorage> toInsertList = new ArrayList<>(); |
|
|
private List<GdInstorage> toInsertList = new ArrayList<>(); |
|
|
private List<GdInstorageLogErr> errList = new ArrayList<>(); |
|
|
private List<GdInstorageLogErr> errList = new ArrayList<>(); |
|
|
private int x = 0, y = 0, errnum = 0; |
|
|
private int x = 0, y = 0, errnum = 0; |
|
|
private String odate = null; |
|
|
private String odate = null; |
|
@ -175,6 +177,14 @@ public class GdInstorageService extends ServiceImpl<GdInstorageMapper, GdInstora |
|
|
String unifiedCode = supplierIndexService.unifiedCode(gd.getColex()); |
|
|
String unifiedCode = supplierIndexService.unifiedCode(gd.getColex()); |
|
|
if (StrUtil.isBlank(unifiedCode)) { |
|
|
if (StrUtil.isBlank(unifiedCode)) { |
|
|
gd.setSupplierCodeUnified(gd.getColex()); |
|
|
gd.setSupplierCodeUnified(gd.getColex()); |
|
|
|
|
|
errnum++; |
|
|
|
|
|
|
|
|
|
|
|
GdInstorageLogErr gile = new GdInstorageLogErr(); |
|
|
|
|
|
gile.setRowNum(x + 1); |
|
|
|
|
|
gile.setErrInfo("未知供应商编号:" + gd.getColex()); |
|
|
|
|
|
gile.setFileFullPath(gdlog.getFileFullPath()); |
|
|
|
|
|
gile.setRowContent(JSONUtil.toJsonStr(r)); |
|
|
|
|
|
errList.add(gile); |
|
|
} else { |
|
|
} else { |
|
|
gd.setSupplierCodeUnified(unifiedCode); |
|
|
gd.setSupplierCodeUnified(unifiedCode); |
|
|
} |
|
|
} |
|
@ -198,6 +208,9 @@ public class GdInstorageService extends ServiceImpl<GdInstorageMapper, GdInstora |
|
|
if (toInsertList != null && !toInsertList.isEmpty()) { |
|
|
if (toInsertList != null && !toInsertList.isEmpty()) { |
|
|
GdInstorageService.this.saveBatch(toInsertList); |
|
|
GdInstorageService.this.saveBatch(toInsertList); |
|
|
} |
|
|
} |
|
|
|
|
|
if (errList != null && !errList.isEmpty()) { |
|
|
|
|
|
gdInstorageLogErrService.saveBatch(errList); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
gdlog.setAllNum(x); |
|
|
gdlog.setAllNum(x); |
|
|
gdlog.setValidNum(y); |
|
|
gdlog.setValidNum(y); |
|
|