luobang 3 年之前
父節點
當前提交
2104b2b446

+ 14 - 2
src/main/java/com/steerinfo/dil/controller/AmstruckInwardRequirementController.java

@@ -5,6 +5,7 @@ import com.steerinfo.dil.model.AmstruckInwardRequirement;
 import com.steerinfo.dil.service.IAmstruckInwardRequirementService;
 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;
@@ -15,6 +16,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;
@@ -43,6 +45,7 @@ public class AmstruckInwardRequirementController extends BaseRESTfulController {
     @Autowired
     ESFeign esFeign;
 
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     /**
      *用车单位提出需求
      *新增用车需求
@@ -140,7 +143,9 @@ public class AmstruckInwardRequirementController extends BaseRESTfulController {
                                                  Integer apiId,
                                                  Integer requirementStatus,
                                                  String orgCode,
-                                                 String index) {
+                                                 String index,
+                                                 String startTime,
+                                                 String endTime) {
         if (mapValue == null) {
             mapValue = new HashMap<>();
         }
@@ -151,6 +156,7 @@ public class AmstruckInwardRequirementController extends BaseRESTfulController {
         if (index != null && !"null".equals(index)) {
             mapValue.put("index","%"+index+"%");
         }
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
         mapValue.put("requirementStatus",requirementStatus);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
@@ -169,7 +175,9 @@ public class AmstruckInwardRequirementController extends BaseRESTfulController {
                                                  String userId,
                                                  String carrierSsoId,
                                                  String enableStatus,
-                                                 String planStatus) {
+                                                 String planStatus,
+                                               String startTime,
+                                               String endTime) {
 
         if (mapValue == null) {
             mapValue = new HashMap<>();
@@ -186,7 +194,11 @@ public class AmstruckInwardRequirementController extends BaseRESTfulController {
         if(planStatus != null){
             mapValue.put("planStatus",planStatus);
         }
+        if(con != null && !"null".equals(con)){
+            mapValue.put("con","%" + con + "%");
+        }
         mapValue.put("requirementStatus",requirementStatus);
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = amstruckInwardRequirementService.getPurRequirementList(mapValue);

+ 1 - 1
src/main/resources/application-prod.yml

@@ -13,7 +13,7 @@ openfeign:
    ESFeign:
      url: ${ESFEIGN_URL:172.16.33.166:8089}
    ColumnDataFeign:
-     url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
+     url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}
    TmsTruckFeign:
       url: ${TMSTRUCKFEIGN_URL:172.16.33.166:8088}
    ImFeign:

+ 19 - 2
src/main/resources/com/steerinfo/dil/mapper/AmstruckInwardRequirementMapper.xml

@@ -840,6 +840,13 @@
         <if test="requirementStatus ==1 ">
             AND AIR.REQUIREMENT_STATUS in (1,2)
         </if>
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= AIR.INSERT_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= AIR.INSERT_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= AIR.INSERT_TIME
+        </if>
         )
         <where>
             <if test="index != null">
@@ -1294,7 +1301,8 @@
         RCR.CARRIER_NAME          "carrierName",
         AIP.PLAN_EABLE_STATUS     "enable",
         AIR.INSERT_TIME           "insertTime",
-        DB.RESULT_FOREIGN_SHIP_NAME     "shipName"
+        DB.RESULT_FOREIGN_SHIP_NAME     "shipName",
+        APO.PURCHASE_ORDER_NO||RS.SUPPLIER_NAME||RW.WAREHOUSE_NAME||RM.MATERIAL_NAME||DB.RESULT_FOREIGN_SHIP_NAME "likeCon"
         FROM AMSTRUCK_INWARD_REQUIREMENT AIR
         LEFT JOIN AMS_PURCHASE_ORDER APO
         ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
@@ -1334,9 +1342,18 @@
         <if test="planStatus != null">
             and AIP.PLAN_STATUS = #{planStatus}
         </if>
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= AIR.INSERT_TIME
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= AIR.INSERT_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= AIR.INSERT_TIME
+        </if>
         )
         <where>
-
+            <if test="con != null">
+                and "likeCon" like #{con}
+            </if>
             <if test="requirementNo != null">
                 and
                 <foreach collection="requirementNo" item="item" open="(" separator="or" close=")">