|
|
|
@ -96,6 +96,8 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
// 读取工作簿 |
|
|
|
XSSFWorkbook workbook = new XSSFWorkbook(is); |
|
|
|
importNotifyExcel(inData, workbook, site, currentUser, excelList); |
|
|
|
} catch (NullPointerException e) { |
|
|
|
throw new RuntimeException("导入失败:网络错误,请重新上传文档"); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException("导入失败:" + e.getMessage()); |
|
|
|
} |
|
|
|
@ -151,22 +153,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
// 读取工作表 |
|
|
|
XSSFSheet sheet = workbook.getSheetAt(s); |
|
|
|
// 剔除空行 |
|
|
|
for (int i = 0; i <= sheet.getLastRowNum(); i++) { |
|
|
|
XSSFRow row = sheet.getRow(i); |
|
|
|
boolean isEmptyRow = true; |
|
|
|
if (row != null) { |
|
|
|
for (Cell cell : row) { |
|
|
|
if (cell.getCellType() != CellType.BLANK && cell.getCellType() != CellType.ERROR && |
|
|
|
!StringUtils.isBlank(String.valueOf(cell))) { |
|
|
|
isEmptyRow = false; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (isEmptyRow) { |
|
|
|
sheet.removeRow(row); // 删除空行 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
deleteEmptyRow(sheet); |
|
|
|
// 获取行数 |
|
|
|
int rows = sheet.getPhysicalNumberOfRows(); |
|
|
|
// 遍历每一行(从第二行开始) |
|
|
|
@ -528,6 +515,8 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
// 读取工作簿 |
|
|
|
XSSFWorkbook workbook = new XSSFWorkbook(is); |
|
|
|
importNotifyExcel(inData, workbook, site, currentUser, excelList); |
|
|
|
} catch (NullPointerException e) { |
|
|
|
throw new RuntimeException("导入失败:网络错误,请重新上传文档"); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException("导入失败:" + e.getMessage()); |
|
|
|
} |
|
|
|
@ -792,22 +781,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
// 读取工作表 |
|
|
|
XSSFSheet sheet = workbook.getSheetAt(0); |
|
|
|
// 剔除空行 |
|
|
|
for (int i = 0; i <= sheet.getLastRowNum(); i++) { |
|
|
|
XSSFRow row = sheet.getRow(i); |
|
|
|
boolean isEmptyRow = true; |
|
|
|
if (row != null) { |
|
|
|
for (Cell cell : row) { |
|
|
|
if (cell.getCellType() != CellType.BLANK && cell.getCellType() != CellType.ERROR && |
|
|
|
!StringUtils.isBlank(String.valueOf(cell))) { |
|
|
|
isEmptyRow = false; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (isEmptyRow) { |
|
|
|
sheet.removeRow(row); // 删除空行 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
deleteEmptyRow(sheet); |
|
|
|
// 获取行数 |
|
|
|
int rows = sheet.getPhysicalNumberOfRows(); |
|
|
|
// 遍历每一行(从第二行开始) |
|
|
|
@ -857,6 +831,8 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
} |
|
|
|
excelList.add(excelData); |
|
|
|
} |
|
|
|
} catch (NullPointerException e) { |
|
|
|
throw new RuntimeException("导入失败:网络错误,请重新上传文档"); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException("导入失败:" + e.getMessage()); |
|
|
|
} |
|
|
|
@ -1044,7 +1020,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
BigDecimal totalGrossWeight = new BigDecimal(0); |
|
|
|
EcssWalMartOrder task = new EcssWalMartOrder(); |
|
|
|
for (EcssCoDelNotifyDetailData detailData : notifys) { |
|
|
|
totalQty = totalQty + detailData.getQty().intValue(); |
|
|
|
totalQty = totalQty + (detailData.getQty()!=null?detailData.getQty().intValue():0); |
|
|
|
if (inData.getWalMartOrderFlag()!=null && inData.getWalMartOrderFlag().equals("Y")) { |
|
|
|
task.setSku(detailData.getPn()); |
|
|
|
task.setQty(detailData.getQty()); |
|
|
|
@ -1066,8 +1042,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
// 根据partNo获取hsCode |
|
|
|
List<Map> packageNoList = coDelMapper.getPackageNoByPartNo(inData.getSite(), partNoList); |
|
|
|
Map<String, String> partPackageMap = new HashMap<>(); |
|
|
|
for (int i = 0; i < packageNoList.size(); i++) { |
|
|
|
Map eorder = packageNoList.get(i); |
|
|
|
for (Map eorder : packageNoList) { |
|
|
|
if (!partPackageMap.containsKey(eorder.get("packageNo"))) { |
|
|
|
partPackageMap.put((String) eorder.get("packageNo"), (String) eorder.get("partNo")); |
|
|
|
} |
|
|
|
@ -1079,7 +1054,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
if (!packageData.isPresent()) { |
|
|
|
throw new RuntimeException("箱号信息不存在!"); |
|
|
|
} |
|
|
|
String partNo = partPackageMap.get(packageData.get().getPackageNo()).toString(); |
|
|
|
String partNo = partPackageMap.get(packageData.get().getPackageNo()); |
|
|
|
// 关务物料属性 |
|
|
|
List<PartSubPropertiesValueData> propertiesValues = coDelMapper.getPropertiesListByTypeAndCodeNo( |
|
|
|
inData.getSite(), "ECSSPART","BG001",inData.getBuNo(), partNo); |
|
|
|
@ -1876,7 +1851,8 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
boolean hasDicimal = false; |
|
|
|
if (pm!=null && !pm.isEmpty()) { |
|
|
|
totalQty = Integer.parseInt(pm.get("total_qty").toString()); |
|
|
|
BigDecimal noCartons = (BigDecimal) pm.get("box_qty"); |
|
|
|
BigDecimal noCartons = pm.get("box_qty")!=null?(BigDecimal) pm.get("box_qty"):BigDecimal.ZERO; |
|
|
|
// 显示箱数零头 有小数 |
|
|
|
if (ecHeader.getBoxChange()!=null && ecHeader.getBoxChange() && noCartons.stripTrailingZeros().scale()>0) { |
|
|
|
noCartons = noCartons.setScale(0, RoundingMode.DOWN); |
|
|
|
hasDicimal = true; |
|
|
|
@ -1988,7 +1964,8 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
int totalQty=palletDetailList.stream().mapToInt(o -> Integer.parseInt(o.get("total_qty").toString())).sum(); |
|
|
|
Map<Object, Map> palletMap = palletDetailList.stream().collect(Collectors.toMap( o -> o.get("part_no"), o -> o)); |
|
|
|
template.addVar("hs_code_desc", stringInput(data.getHsCodeDescType()!=null&& data.getHsCodeDescType().equals("N")? |
|
|
|
nodifyDetailList.get(0).get("hsCodeDescEn").toString():nodifyDetailList.get(0).get("hsCodeDesc").toString())); |
|
|
|
(nodifyDetailList.get(0).get("hsCodeDescEn")!=null?nodifyDetailList.get(0).get("hsCodeDescEn").toString():""): |
|
|
|
(nodifyDetailList.get(0).get("hsCodeDesc")!=null?nodifyDetailList.get(0).get("hsCodeDesc").toString():""))); |
|
|
|
template.addVar("hs_code", stringInput(nodifyDetailList.get(0).get("hsCode").toString())); |
|
|
|
Map<Object, Object> poNoMap = new HashMap<>(); |
|
|
|
BigDecimal ttlAmount = BigDecimal.ZERO; |
|
|
|
@ -2352,21 +2329,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
// 读取工作表 |
|
|
|
XSSFSheet sheet = workbook.getSheetAt(0); |
|
|
|
// 剔除空行 |
|
|
|
for (int i = 0; i <= sheet.getLastRowNum(); i++) { |
|
|
|
XSSFRow row = sheet.getRow(i); |
|
|
|
boolean isEmptyRow = true; |
|
|
|
if (row != null) { |
|
|
|
for (Cell cell : row) { |
|
|
|
if (cell.getCellType() != CellType.BLANK) { |
|
|
|
isEmptyRow = false; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (isEmptyRow) { |
|
|
|
sheet.removeRow(row); // 删除空行 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
deleteEmptyRow(sheet); |
|
|
|
// 获取行数 |
|
|
|
int rows = sheet.getPhysicalNumberOfRows(); |
|
|
|
// 遍历每一行(从第二行开始) |
|
|
|
@ -2415,6 +2378,25 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private static void deleteEmptyRow(XSSFSheet sheet) { |
|
|
|
for (int i = 0; i <= sheet.getLastRowNum(); i++) { |
|
|
|
XSSFRow row = sheet.getRow(i); |
|
|
|
boolean isEmptyRow = true; |
|
|
|
if (row != null) { |
|
|
|
for (Cell cell : row) { |
|
|
|
if (cell.getCellType() != CellType.BLANK && cell.getCellType() != CellType.ERROR && |
|
|
|
!StringUtils.isBlank(String.valueOf(cell))) { |
|
|
|
isEmptyRow = false; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (isEmptyRow) { |
|
|
|
sheet.removeRow(row); // 删除空行 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<Map> getPropertiesListByDeclaration(EcssDeclarationHeaderData data) { |
|
|
|
// 获取partNo列表 |
|
|
|
|