Browse Source

首次提交

zhs 3 years ago
parent
commit
26366087de

+ 11 - 0
src/main/java/com/model/controller/DispatchController.java

@@ -59,6 +59,17 @@ public class DispatchController {
         return dispatchService.getDispatchList(dispatch);
     }
 
+    /**
+     * 查询发货日志
+     * @param dispatch
+     * @return
+     */
+    @GetMapping("getDispatchListLog")
+    @PassToken
+    private CommRes getDispatchListLog(Dispatch dispatch){
+        return dispatchService.getDispatchListLog(dispatch);
+    }
+
     /**
      * @Description: 更改异常状态
      * @Param: id

+ 4 - 0
src/main/java/com/model/entity/Dispatch.java

@@ -108,4 +108,8 @@ public class Dispatch implements Serializable {
      * 条数
      */
     private int limit;
+    /**
+     * 客户名称
+     */
+    private String name;
 }

+ 2 - 0
src/main/java/com/model/mapper/DispatchMapper.java

@@ -27,4 +27,6 @@ public interface DispatchMapper {
     Dispatch getDispatchs(Dispatch dispatch);
 
     void updArrivalTime(Dispatch dispatch);
+
+    List<Dispatch> getDispatchListLog(Dispatch dispatch);
 }

+ 2 - 0
src/main/java/com/model/service/DispatchService.java

@@ -16,4 +16,6 @@ public interface DispatchService {
     CommRes updAnomaly(Dispatch dispatch);
 
     CommRes updArrivalTime(Dispatch dispatch);
+
+    CommRes getDispatchListLog(Dispatch dispatch);
 }

+ 16 - 0
src/main/java/com/model/service/impl/DispatchServiceImpl.java

@@ -10,6 +10,7 @@ import com.model.mapper.DispatchMapper;
 import com.model.result.CommRes;
 import com.model.service.ClientService;
 import com.model.service.DispatchService;
+import com.model.util.DesEncry;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -162,4 +163,19 @@ public class DispatchServiceImpl implements DispatchService {
         return CommRes.success(null);
     }
 
+    @Override
+    public CommRes getDispatchListLog(Dispatch dispatch) {
+        List<Dispatch> list = null;
+        try {
+            list = dispatchMapper.getDispatchListLog(dispatch);
+            for (Dispatch dispatch1 : list) {
+                List<DispatchSublist> list1 = dispatchMapper.getDispatchLists(dispatch1);
+                dispatch1.setDataList(list1);
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return CommRes.success(list);
+    }
+
 }

+ 31 - 2
src/main/resources/mapper/DispatchMapper.xml

@@ -44,6 +44,34 @@
                states
         from sg_dispatch where truck_no = #{truckNo} and customer = #{customer}
     </select>
+    <!-- 查询发货日志 -->
+    <select id="getDispatchListLog" resultType="com.model.entity.Dispatch">
+        select
+            a.id,
+            a.truck_no,
+            a.customer,
+            a.scrq,
+            a.arrival_time,
+            a.anomaly,
+            a.note,
+            a.imgs,
+            a.final_time,
+            a.uuid,
+            a.states,
+            b.days as days,
+            b.name
+        from sg_dispatch a
+        left join sg_client b on a.customer = b.code
+        <trim prefix="WHERE" prefixOverrides="and |or">
+            <if test="agoScrq != null and agoScrq != ''">
+                and a.arrival_time <![CDATA[>=]]> #{agoScrq}
+            </if>
+            <if test="endScrq != null and endScrq != ''">
+                and a.arrival_time <![CDATA[<=]]> #{endScrq}
+            </if>
+        </trim>
+        order by a.arrival_time
+    </select>
     <!--查询父表信息-->
     <select id="getDispatchList" resultType="com.model.entity.Dispatch">
         select
@@ -58,7 +86,8 @@
             a.final_time,
             a.uuid,
             a.states,
-            b.days as days
+            b.days as days,
+            b.name
         from sg_dispatch a
         left join sg_client b on a.customer = b.code
         <trim prefix="WHERE" prefixOverrides="and |or">
@@ -90,7 +119,7 @@
                 and a.arrival_time = #{arrivalTime}
             </if>
         </trim>
-        order by a.id desc
+        order by a.arrival_time
     </select>
     <!--根据父表uuid查询子表信息-->
     <select id="getDispatchLists" resultType="com.model.entity.DispatchSublist">