wfg 5 miesięcy temu
rodzic
commit
bb09beef9a

+ 5 - 0
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/TemplateImportServiceImpl.java

@@ -9,6 +9,7 @@ import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.los.Util.BigDecimalUtils;
 import org.springblade.los.Util.RegularUtils;
 import org.springblade.los.basic.packages.entity.BPackages;
 import org.springblade.los.basic.packages.service.IBPackagesService;
@@ -541,6 +542,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 				}
 
 				bills.setQuantity(new BigDecimal(String.valueOf(pkgs.get("value"))).setScale(0, RoundingMode.HALF_UP));
+				bills.setQuantityPackingDescr("SAY " + BigDecimalUtils.convertToEnglish(bills.getQuantity()) + " " + bills.getPackingUnit() + " ONLY.");
 
 				//G.W.
 				double gw = getSheetCellValueAsNumericPrefix(sheet, r + 1, 4);
@@ -817,6 +819,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 			double bags = getSheetCellValueAsNumericPrefix(sheet,28, 2);
 			System.out.println("bags:" + bags);
 			bills.setQuantity(new BigDecimal(bags).setScale(0, RoundingMode.HALF_UP));
+			bills.setQuantityPackingDescr("SAY " + BigDecimalUtils.convertToEnglish(bills.getQuantity()) + " " + bills.getPackingUnit() + " ONLY.");
 		} else {
 			throw new RuntimeException("件数不能为空");
 		}
@@ -1084,6 +1087,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 			double bags = getSheetCellValueAsNumericPrefix(sheet,28, 2);
 			System.out.println("bags:" + bags);
 			bills.setQuantity(new BigDecimal(bags).setScale(0, RoundingMode.HALF_UP));
+			bills.setQuantityPackingDescr("SAY " + BigDecimalUtils.convertToEnglish(bills.getQuantity()) + " " + bills.getPackingUnit() + " ONLY.");
 		} else {
 			throw new RuntimeException("件数不能为空");
 		}
@@ -1313,6 +1317,7 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 
 				sumQty.setScale(0, BigDecimal.ROUND_HALF_UP);
 				bills.setQuantity(sumQty);
+				bills.setQuantityPackingDescr("SAY " + BigDecimalUtils.convertToEnglish(bills.getQuantity()) + " " + bills.getPackingUnit() + " ONLY.");
 				bills.setCfsQuantity(sumQty);
 				sumGw.setScale(3, BigDecimal.ROUND_HALF_UP);
 				bills.setGrossWeight(sumGw);