|
|
@@ -1174,6 +1174,10 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
|
|
|
bills.setPackingUnitId(packages.getId());
|
|
|
bills.setPackingUnit(packages.getCode());
|
|
|
}
|
|
|
+ BigDecimal sumQty = new BigDecimal(0L);
|
|
|
+ BigDecimal sumGw = new BigDecimal(0L);
|
|
|
+ BigDecimal sumVol = new BigDecimal(BigInteger.ZERO);
|
|
|
+
|
|
|
for(int cr=r+1; cr<=lastRow; cr++) {
|
|
|
String cntrType = getSheetCellValueAsString(sheet, cr, 0);
|
|
|
String cntrNo = getSheetCellValueAsString(sheet, cr, 1);
|
|
|
@@ -1182,9 +1186,15 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
|
|
|
containers.setCntrTypeCode(cntrType);
|
|
|
containers.setCntrNo(cntrNo);
|
|
|
containers.setSealNo(getSheetCellValueAsString(sheet, cr, 2));
|
|
|
- containers.setQuantity(BigDecimal.valueOf(getSheetCellValueAsDouble(sheet, cr, 3)));
|
|
|
- containers.setGrossWeight(BigDecimal.valueOf(getSheetCellValueAsDouble(sheet, cr, 4)));
|
|
|
- containers.setMeasurement(BigDecimal.valueOf(getSheetCellValueAsDouble(sheet, cr, 5)));
|
|
|
+ double q1 = getSheetCellValueAsDouble(sheet, cr, 3);
|
|
|
+ containers.setQuantity(BigDecimal.valueOf(q1));
|
|
|
+ sumQty = sumQty.add(new BigDecimal(q1));
|
|
|
+ double w1 = getSheetCellValueAsDouble(sheet, cr, 4);
|
|
|
+ containers.setGrossWeight(BigDecimal.valueOf(w1));
|
|
|
+ sumGw = sumGw.add(new BigDecimal(w1));
|
|
|
+ double v1 = getSheetCellValueAsDouble(sheet, cr, 5);
|
|
|
+ containers.setMeasurement(BigDecimal.valueOf(v1));
|
|
|
+ sumVol = sumVol.add(new BigDecimal(v1));
|
|
|
if(ObjectUtils.isNotNull(packages)){
|
|
|
containers.setPackingUnitId(packages.getId());
|
|
|
containers.setPackingUnit(packages.getCode());
|
|
|
@@ -1192,6 +1202,13 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
|
|
|
containersList.add(containers);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ sumQty.setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
+ bills.setQuantity(sumQty);
|
|
|
+ sumGw.setScale(3, BigDecimal.ROUND_HALF_UP);
|
|
|
+ bills.setGrossWeight(sumGw);
|
|
|
+ sumVol.setScale(3, BigDecimal.ROUND_HALF_UP);
|
|
|
+ bills.setMeasurement(sumVol);
|
|
|
}
|
|
|
}
|
|
|
|