luobang 3 سال پیش
والد
کامیت
073d78fa23

+ 11 - 4
src/main/java/com/steerinfo/dil/controller/AmstruckSporadicOrderController.java

@@ -5,17 +5,17 @@ import com.steerinfo.dil.feign.ESFeign;
 import com.steerinfo.dil.service.IAmstruckSporadicOrderService;
 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;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.HashMap;
+import java.text.SimpleDateFormat;
 import java.util.List;
 import java.util.Map;
 
@@ -46,6 +46,7 @@ public class AmstruckSporadicOrderController extends BaseRESTfulController {
     @Autowired
     ESFeign esFeign;
 
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
     @ApiOperation(value="新增零星物资进出厂(以及销售钢材退货),包括内转精煤")
     @PostMapping("/addSporadicOrders")
@@ -86,9 +87,12 @@ public class AmstruckSporadicOrderController extends BaseRESTfulController {
                                                Integer sporadicStatus,
                                                String carrierSsoId,
                                                String userId,
-                                               String userIds) {
-
+                                               String userIds,
+                                               String startTime,
+                                               String endTime
+                                               ) {
 
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
         if (orderType!=null){
             mapValue.put("orderType",orderType);
         }
@@ -110,6 +114,9 @@ public class AmstruckSporadicOrderController extends BaseRESTfulController {
         if (userIds!=null){
             mapValue.put("userIds",userIds);
         }
+        if(con != null && !"null".equals(con)){
+            mapValue.put("con","%" + con + "%");
+        }
         PageHelper.startPage(pageNum,pageSize);
         List<Map<String, Object>> columnList = amstruckSporadicOrderService.getSporadicOrdersList(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,columnList);

+ 12 - 1
src/main/resources/com/steerinfo/dil/mapper/AmstruckSporadicMaterialMapper.xml

@@ -461,7 +461,8 @@
   OO.ORDER_TYPE AS "type",
   ASO.TRANS_STATUS "transStatus",
   ASO.SPORADIC_ORDER_TIMES "orderTimes",
-  ASO.SPORADIC_TRANS_TIMES "transTimes"
+  ASO.SPORADIC_TRANS_TIMES "transTimes",
+  RSU.SUPPLIER_NAME || RCO.CONSIGNEE_COMPANY_NAME "likeCon"
   FROM AMSTRUCK_SPORADIC_ORDER ASO
   LEFT JOIN RMS_CONSIGNEE RCO
   ON ASO.RECEIVE_UNIT_ID = RCO.CONSIGNEE_ID
@@ -483,8 +484,18 @@
   <if test="dispatchStatus != null">
     AND ASO.DISPATCH_STATUS =  #{dispatchStatus}
   </if>
+  <if test="oneDate != null">
+    and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= ASO.INSERT_TIME
+  </if>
+  <if test="startDate != null">
+    and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= ASO.INSERT_TIME
+    and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= ASO.INSERT_TIME
+  </if>
   )
   <where>
+    <if test="con != null">
+      and "likeCon" like #{con}
+    </if>
     <if test="sporadicOrderNo != null">
       and
       <foreach collection="sporadicOrderNo" item="item" open="(" separator="or" close=")">