liyg 2 роки тому
батько
коміт
1a0315284c

+ 4 - 1
src/main/java/com/steerinfo/dil/controller/AmstruckInwardPlanController.java

@@ -4,6 +4,7 @@ import com.steerinfo.dil.model.AmstruckInwardPlan;
 import com.steerinfo.dil.service.IAmstruckInwardPlanService;
 import com.steerinfo.dil.util.BaseRESTfulController;
 import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageHelper;
@@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -41,7 +43,7 @@ public class AmstruckInwardPlanController extends BaseRESTfulController {
     IAmstruckInwardPlanService amstruckInwardPlanService;
     @Autowired
     ColumnDataUtil columnDataUtil;
-
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     /**
      *新增运输计划
      */
@@ -153,6 +155,7 @@ public class AmstruckInwardPlanController extends BaseRESTfulController {
         }
         List<Map<String, Object>> columnList = null;
         PageHelper.startPage(pageNum, pageSize);
+        DataChange.queryDataByDateTime(""+mapValue.get("startTime"),""+mapValue.get("endTime"),mapValue,sdfDateTime);
         if(planStatus == 100){
             columnList = amstruckInwardPlanService.getTruckPlanList2(mapValue);
         }else {

+ 10 - 0
src/main/resources/com/steerinfo/dil/mapper/AmstruckInwardPlanMapper.xml

@@ -478,6 +478,10 @@
         AND AIR.PURCHASE_ORDER_ID IS NULL
         )
         <where>
+            <if test="startDate != null">
+                and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= "requirementTruckTime"
+                and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= "requirementTruckTime"
+            </if>
             <if test="purchaseOrderNo != null">
                 <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
                     "purchaseOrderNo" like '%${item}%'
@@ -666,17 +670,23 @@
                     "planNumber" like '%${item}%'
                 </foreach>
             </if>
+            <if test="startDate != null">
+                and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= "requirementTruckTime"
+                and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= "requirementTruckTime"
+            </if>
             <if test="materialName != null">
                 <foreach collection="materialName" item="item" open="(" separator="or" close=")">
                     "materialName" like '%${item}%'
                 </foreach>
             </if>
             <if test="loadName != null">
+                and
                 <foreach collection="loadName" item="item" open="(" separator="or" close=")">
                     "loadName" like '%${item}%'
                 </foreach>
             </if>
             <if test="unloadName != null">
+                and
                 <foreach collection="unloadName" item="item" open="(" separator="or" close=")">
                     "unloadName" like '%${item}%'
                 </foreach>

+ 6 - 0
src/main/resources/com/steerinfo/dil/mapper/AmstruckInwardRequirementMapper.xml

@@ -1464,6 +1464,12 @@
                     "carrierName" like '%${item}%'
                 </foreach>
             </if>
+            <if test="shipName != null">
+                and
+                <foreach collection="shipName" item="item" open="(" separator="or" close=")">
+                    "shipName" like '%${item}%'
+                </foreach>
+            </if>
             <if test="insertTime != null">
                 and
                 <foreach collection="insertTime" item="item" open="(" separator="or" close=")">