jz.kai %!s(int64=3) %!d(string=hai) anos
pai
achega
4e550bf588

+ 3 - 3
common/src/main/java/com/jpsoft/order/modules/base/entity/OrderForm.java

@@ -33,7 +33,7 @@ public class OrderForm {
         @ApiModelProperty(value = "产品规格")
     private String productSpecification;
         @ApiModelProperty(value = "订单数量")
-    private Integer orderQuantity;
+    private Double orderQuantity;
         @ApiModelProperty(value = "单位")
     private String unit;
         @DateTimeFormat(pattern="yyyy-MM-dd")
@@ -45,9 +45,9 @@ public class OrderForm {
 	    @ApiModelProperty(value = "评审交期")
     private Date reviewDeliveryTime;
         @ApiModelProperty(value = "库存数量")
-    private Integer stockQuantity;
+    private Double stockQuantity;
         @ApiModelProperty(value = "还需生产数量")
-    private Integer productionQuantity;
+    private Double productionQuantity;
         @DateTimeFormat(pattern="yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
 	    @ApiModelProperty(value = "过期时间")

+ 19 - 12
web/src/main/java/com/jpsoft/order/modules/base/controller/OrderFormController.java

@@ -339,7 +339,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strOrderQuantity)) {
                             try {
-                                orderForm.setOrderQuantity(Integer.parseInt(strOrderQuantity));
+                                orderForm.setOrderQuantity(Double.parseDouble(strOrderQuantity));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("订单数量数据错误!");
                                 failCount++;
@@ -361,7 +361,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strRequiredDeliveryTime)) {
                             try {
-                                orderForm.setRequiredDeliveryTime(sdf.parse(strRequiredDeliveryTime));
+                                orderForm.setRequiredDeliveryTime(getDate(Integer.parseInt(strRequiredDeliveryTime)));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("要求交期数据错误!");
                                 failCount++;
@@ -375,7 +375,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strReviewDeliveryTime)) {
                             try {
-                                orderForm.setReviewDeliveryTime(sdf.parse(strReviewDeliveryTime));
+                                orderForm.setReviewDeliveryTime(getDate(Integer.parseInt(strReviewDeliveryTime)));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("评审交期数据错误!");
                                 failCount++;
@@ -389,7 +389,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strStockQuantity)) {
                             try {
-                                orderForm.setStockQuantity(Integer.parseInt(strStockQuantity));
+                                orderForm.setStockQuantity(Double.parseDouble(strStockQuantity));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("库存数量数据错误!");
                                 failCount++;
@@ -403,7 +403,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strProductionQuantity)) {
                             try {
-                                orderForm.setProductionQuantity(Integer.parseInt(strProductionQuantity));
+                                orderForm.setProductionQuantity(Double.parseDouble(strProductionQuantity));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("还需生产数量数据错误!");
                                 failCount++;
@@ -417,7 +417,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strExpiryTime)) {
                             try {
-                                orderForm.setExpiryTime(sdf.parse(strExpiryTime));
+                                orderForm.setExpiryTime(getDate(Integer.parseInt(strExpiryTime)));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("过期时间数据错误!");
                                 failCount++;
@@ -497,7 +497,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strOrderQuantity)) {
                             try {
-                                orderForm.setOrderQuantity(Integer.parseInt(strOrderQuantity));
+                                orderForm.setOrderQuantity(Double.parseDouble(strOrderQuantity));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("订单数量数据错误!");
                                 failCount++;
@@ -519,7 +519,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strRequiredDeliveryTime)) {
                             try {
-                                orderForm.setRequiredDeliveryTime(sdf.parse(strRequiredDeliveryTime));
+                                orderForm.setRequiredDeliveryTime(getDate(Integer.parseInt(strRequiredDeliveryTime)));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("要求交期数据错误!");
                                 failCount++;
@@ -533,7 +533,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strReviewDeliveryTime)) {
                             try {
-                                orderForm.setReviewDeliveryTime(sdf.parse(strReviewDeliveryTime));
+                                orderForm.setReviewDeliveryTime(getDate(Integer.parseInt(strReviewDeliveryTime)));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("评审交期数据错误!");
                                 failCount++;
@@ -547,7 +547,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strStockQuantity)) {
                             try {
-                                orderForm.setStockQuantity(Integer.parseInt(strStockQuantity));
+                                orderForm.setStockQuantity(Double.parseDouble(strStockQuantity));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("库存数量数据错误!");
                                 failCount++;
@@ -561,7 +561,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strProductionQuantity)) {
                             try {
-                                orderForm.setProductionQuantity(Integer.parseInt(strProductionQuantity));
+                                orderForm.setProductionQuantity(Double.parseDouble(strProductionQuantity));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("还需生产数量数据错误!");
                                 failCount++;
@@ -575,7 +575,7 @@ public class OrderFormController {
 
                         if (StringUtils.isNotEmpty(strExpiryTime)) {
                             try {
-                                orderForm.setExpiryTime(sdf.parse(strExpiryTime));
+                                orderForm.setExpiryTime(getDate(Integer.parseInt(strExpiryTime)));
                             } catch (Exception ex) {
                                 sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("过期时间数据错误!");
                                 failCount++;
@@ -635,4 +635,11 @@ public class OrderFormController {
 
         return msgResult;
     }
+
+    private Date getDate(int days){
+        Calendar calendar = new GregorianCalendar(1900,0,-1);
+        calendar.add(calendar.DATE, days);
+
+        return calendar.getTime();
+    }
 }