Parcourir la source

更新地磅称重接口参数。

zhuoning il y a 2 ans
Parent
commit
47a17eaa59

+ 11 - 1
huimv-farm-produce/src/main/java/com/huimv/produce/produce/controller/WeightController.java

@@ -4,10 +4,12 @@ import com.huimv.common.utils.Result;
 import com.huimv.produce.produce.service.IWeight;
 import com.huimv.produce.produce.utils.DateUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.text.ParseException;
+import java.util.Date;
 
 /**
  * @Project : huimv.shiwan
@@ -52,8 +54,16 @@ public class WeightController {
                                    @RequestParam(value = "pageNo",required = true) Integer pageNo,
                                    @RequestParam(value = "pageSize",required = true) Integer pageSize) throws ParseException {
         DateUtil du = new DateUtil();
+        Date startDate2 = null;
+        if(StringUtils.isNotBlank(startDate)){
+            startDate2 = du.parseDate(startDate);
+        }
+        Date endDate2 = null;
+        if(StringUtils.isNotBlank(endDate)){
+            endDate2 = du.parseDate(endDate);
+        }
         //
-        return weight.getWeightDetails(poundType, carNumber,consigner,consignee,variety, du.parseDate(startDate),du.parseDate(endDate),pageNo,pageSize);
+        return weight.getWeightDetails(poundType, carNumber,consigner,consignee,variety,startDate2 ,endDate2,pageNo,pageSize);
     }