浏览代码

凯和首页接口

lazhaoqian 3 年之前
父节点
当前提交
6369526a98
共有 17 个文件被更改,包括 413 次插入133 次删除
  1. 50 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/HomePage.java
  2. 6 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TCntrnoMapper.java
  3. 6 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TVoyageMapper.java
  4. 8 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TWarehousebillsCntritemsMapper.java
  5. 5 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITCntrnoService.java
  6. 5 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITVoyageService.java
  7. 7 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITWarehousebillsCntritemsService.java
  8. 5 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TCntrnoServiceImpl.java
  9. 5 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TVoyageServiceImpl.java
  10. 7 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TWarehousebillsCntritemsServiceImpl.java
  11. 21 0
      ruoyi-shipping/src/main/resources/mapper/shipping/TCntrnoMapper.xml
  12. 208 133
      ruoyi-shipping/src/main/resources/mapper/shipping/TVoyageMapper.xml
  13. 39 0
      ruoyi-shipping/src/main/resources/mapper/shipping/TWarehousebillsCntritemsMapper.xml
  14. 6 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsfeesMapper.java
  15. 6 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehousebillsfeesService.java
  16. 6 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehousebillsfeesServiceImpl.java
  17. 23 0
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

+ 50 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/HomePage.java

@@ -0,0 +1,50 @@
+package com.ruoyi.web.controller.shipping.controller;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.shipping.service.ITCntrnoService;
+import com.ruoyi.shipping.service.ITVesselService;
+import com.ruoyi.shipping.service.ITVoyageService;
+import com.ruoyi.shipping.service.ITWarehousebillsCntritemsService;
+import com.ruoyi.warehouseBusiness.service.ITWarehousebillsfeesService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/shipping/homePage")
+public class HomePage  extends BaseController {
+    @Autowired
+    private ITCntrnoService tCntrnoService;
+    @Autowired
+    private ITWarehousebillsfeesService itWarehousebillsfeesService;
+    @Autowired
+    private ITWarehousebillsCntritemsService itWarehousebillsCntritemsService;
+    @Autowired
+    private ITVoyageService itVoyageService;
+
+    //首页箱分布
+    @GetMapping("/homeBox")
+    public AjaxResult homeBox(){
+        return AjaxResult.success(tCntrnoService.homeBox());
+    }
+    //船动态
+    @GetMapping("/shipDynamic")
+    public AjaxResult shipDynamic(){
+        return AjaxResult.success(itVoyageService.shipDynamic());
+    }
+    //订舱排名
+    @GetMapping("/bookingSpace")
+    public AjaxResult bookingSpace(){
+        return AjaxResult.success(itWarehousebillsCntritemsService.bookingSpace());
+    }
+    //应收款排名
+    @GetMapping("/accountsDue")
+    public AjaxResult accountsDue(){
+        return AjaxResult.success(itWarehousebillsfeesService.accountsDue());
+    }
+}

+ 6 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TCntrnoMapper.java

@@ -153,4 +153,10 @@ public interface TCntrnoMapper
      */
     public List<TCntrno> getBoxRemark(@Param("fUpdateaddress") String fUpdateaddress);
 
+    /**
+     * 首页获取箱分布
+     * @return
+     */
+    public List<Map<String,Object>>homeBox();
+
 }

+ 6 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TVoyageMapper.java

@@ -119,4 +119,10 @@ public interface TVoyageMapper
      * @return
      */
     public TVoyage selectTVoyageByFid(Long fId);
+
+    /**
+     * 首页获取船动态
+     * @return
+     */
+    public List<Map<String,Object>>shipDynamic();
 }

+ 8 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TWarehousebillsCntritemsMapper.java

@@ -1,6 +1,8 @@
 package com.ruoyi.shipping.mapper;
 
 import java.util.List;
+import java.util.Map;
+
 import com.ruoyi.shipping.domain.TWarehousebillsCntritems;
 
 /**
@@ -80,4 +82,10 @@ public interface TWarehousebillsCntritemsMapper
      * @return 结果
      */
     public int deleteTWarehousebillsCntritemsfPids(Long[] fPids);
+
+    /**
+     * 首页获取订舱排名
+     * @return
+     */
+    public List<Map<String,Object>>bookingSpace();
 }

+ 5 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITCntrnoService.java

@@ -164,4 +164,9 @@ public interface ITCntrnoService
      * @return
      */
     public List<BoxDistributionStatistics> boxDistributedStatistics();
+    /**
+     * 首页获取箱分布
+     * @return
+     */
+    public List<Map<String,Object>>homeBox();
 }

+ 5 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITVoyageService.java

@@ -108,4 +108,9 @@ public interface ITVoyageService
      * @return 航次集合
      */
     public List<TVoyage> createOrder(TVoyage tVoyage);
+    /**
+     * 首页获取船动态
+     * @return
+     */
+    public List<Map<String,Object>>shipDynamic();
 }

+ 7 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITWarehousebillsCntritemsService.java

@@ -1,6 +1,8 @@
 package com.ruoyi.shipping.service;
 
 import java.util.List;
+import java.util.Map;
+
 import com.ruoyi.shipping.domain.TWarehousebillsCntritems;
 
 /**
@@ -58,4 +60,9 @@ public interface ITWarehousebillsCntritemsService
      * @return 结果
      */
     public int deleteTWarehousebillsCntritemsById(Long fId);
+    /**
+     * 首页获取订舱排名
+     * @return
+     */
+    public List<Map<String,Object>>bookingSpace();
 }

+ 5 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TCntrnoServiceImpl.java

@@ -796,6 +796,11 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
         return list;
     }
 
+    @Override
+    public List<Map<String, Object>> homeBox() {
+        return tCntrnoMapper.homeBox();
+    }
+
     /**
      * set字段
      *

+ 5 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TVoyageServiceImpl.java

@@ -397,4 +397,9 @@ public class TVoyageServiceImpl implements ITVoyageService
         }
         return tVoyages;
     }
+
+    @Override
+    public List<Map<String, Object>> shipDynamic() {
+        return tVoyageMapper.shipDynamic();
+    }
 }

+ 7 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TWarehousebillsCntritemsServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ruoyi.shipping.service.impl;
 
 import java.util.List;
+import java.util.Map;
+
 import com.ruoyi.common.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -93,4 +95,9 @@ public class TWarehousebillsCntritemsServiceImpl implements ITWarehousebillsCntr
     {
         return tWarehousebillsCntritemsMapper.deleteTWarehousebillsCntritemsById(fId);
     }
+
+    @Override
+    public List<Map<String, Object>> bookingSpace() {
+        return tWarehousebillsCntritemsMapper.bookingSpace();
+    }
 }

+ 21 - 0
ruoyi-shipping/src/main/resources/mapper/shipping/TCntrnoMapper.xml

@@ -675,6 +675,27 @@ FROM
 	f_updateaddress = #{fUpdateaddress}
 	AND remark IS NOT NULL
     </select>
+    <select id="homeBox" resultType="map">
+        SELECT
+	ta.f_name addressName,
+	IFNULL(COUNT(1),0) boxNumber
+FROM
+	t_cntrno tc
+	LEFT JOIN t_address ta ON tc.f_updateaddress = ta.f_id
+WHERE
+	ta.f_name != '在船'
+GROUP BY tc.f_updateaddress
+UNION
+SELECT
+	tc.remark addressName,
+	IFNULL(COUNT(1),0) boxNumber
+FROM
+	t_cntrno tc
+	LEFT JOIN t_address ta ON tc.f_updateaddress = ta.f_id
+WHERE
+	ta.f_name = '在船'
+GROUP BY tc.remark
+    </select>
 
 
 </mapper>

+ 208 - 133
ruoyi-shipping/src/main/resources/mapper/shipping/TVoyageMapper.xml

@@ -1,34 +1,34 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.shipping.mapper.TVoyageMapper">
 
     <resultMap type="TVoyage" id="TVoyageResult">
-        <result property="fId"    column="f_id"    />
-        <result property="fPid"    column="f_pid"    />
-        <result property="fNo"    column="f_no"    />
-        <result property="fPortofloadid"    column="f_portofloadid"    />
-        <result property="fPortofdischargeid"    column="f_portofdischargeid"    />
-        <result property="fDistinationid"    column="f_distinationid"    />
-        <result property="fPortoftransshipment"    column="f_portoftransshipment"    />
-        <result property="fEtd"    column="f_ETD"    />
-        <result property="fAtd"    column="f_ATD"    />
-        <result property="fEta"    column="f_ETA"    />
-        <result property="fAta"    column="f_ATA"    />
-        <result property="fDays"    column="f_days"    />
-        <result property="fDucomentrayoffdate"    column="f_ducomentrayoffdate"    />
-        <result property="fCutoffdate"    column="f_cutoffdate"    />
-        <result property="fTeu"    column="f_teu"    />
-        <result property="fManageid"    column="f_manageid"    />
-        <result property="fTel"    column="f_tel"    />
-        <result property="fStatus"    column="f_status"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="remark"    column="remark"    />
-        <result property="fLaneid"    column="f_laneid"    />
+        <result property="fId" column="f_id"/>
+        <result property="fPid" column="f_pid"/>
+        <result property="fNo" column="f_no"/>
+        <result property="fPortofloadid" column="f_portofloadid"/>
+        <result property="fPortofdischargeid" column="f_portofdischargeid"/>
+        <result property="fDistinationid" column="f_distinationid"/>
+        <result property="fPortoftransshipment" column="f_portoftransshipment"/>
+        <result property="fEtd" column="f_ETD"/>
+        <result property="fAtd" column="f_ATD"/>
+        <result property="fEta" column="f_ETA"/>
+        <result property="fAta" column="f_ATA"/>
+        <result property="fDays" column="f_days"/>
+        <result property="fDucomentrayoffdate" column="f_ducomentrayoffdate"/>
+        <result property="fCutoffdate" column="f_cutoffdate"/>
+        <result property="fTeu" column="f_teu"/>
+        <result property="fManageid" column="f_manageid"/>
+        <result property="fTel" column="f_tel"/>
+        <result property="fStatus" column="f_status"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+        <result property="fLaneid" column="f_laneid"/>
     </resultMap>
 
     <sql id="selectTVoyageVo">
@@ -81,42 +81,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN t_address td ON tv.f_portofdischargeid = td.f_id
         LEFT JOIN t_address tr ON tv.f_distinationid = tr.f_id
         LEFT JOIN t_address ts ON tv.f_portoftransshipment = ts.f_id
-        LEFT JOIN sys_user  su ON tv.f_manageid = su.user_id
+        LEFT JOIN sys_user su ON tv.f_manageid = su.user_id
         LEFT JOIN t_address tes ON tv.f_laneid = tes.f_id
         <where>
             tv.f_status = 'T'
-            <if test="fPid != null "> and tv.f_pid = #{fPid}</if>
-            <if test="fNo != null  and fNo != ''"> and tv.f_no = #{fNo}</if>
-            <if test="fPortofloadid != null "> and tv.f_portofloadid = #{fPortofloadid}</if>
-            <if test="fPortofdischargeid != null "> and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
-            <if test="fDistinationid != null "> and tv.f_distinationid = #{fDistinationid}</if>
-            <if test="fPortoftransshipment != null "> and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
-            <if test="fPortoftransshipment == null and empty != null"> and tv.f_portoftransshipment IS NULL</if>
-            <if test="fEtd != null "> and tv.f_ETD = #{fEtd}</if>
-            <if test="fAtd != null "> and tv.f_ATD = #{fAtd}</if>
-            <if test="fEta != null "> and tv.f_ETA = #{fEta}</if>
-            <if test="fAta != null "> and tv.f_ATA = #{fAta}</if>
-            <if test="fDays != null "> and tv.f_days = #{fDays}</if>
-            <if test="fDucomentrayoffdate != null "> and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
-            <if test="fCutoffdate != null "> and tv.f_cutoffdate = #{fCutoffdate}</if>
-            <if test="fTeu != null  and fTeu != ''"> and tv.f_teu = #{fTeu}</if>
-            <if test="fManageid != null "> and tv.f_manageid = #{fManageid}</if>
-            <if test="fTel != null  and fTel != ''"> and tv.f_tel = #{fTel}</if>
-            <if test="fStatus != null  and fStatus != ''"> and tv.f_status = #{fStatus}</if>
+            <if test="fPid != null ">and tv.f_pid = #{fPid}</if>
+            <if test="fNo != null  and fNo != ''">and tv.f_no = #{fNo}</if>
+            <if test="fPortofloadid != null ">and tv.f_portofloadid = #{fPortofloadid}</if>
+            <if test="fPortofdischargeid != null ">and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
+            <if test="fDistinationid != null ">and tv.f_distinationid = #{fDistinationid}</if>
+            <if test="fPortoftransshipment != null ">and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
+            <if test="fPortoftransshipment == null and empty != null">and tv.f_portoftransshipment IS NULL</if>
+            <if test="fEtd != null ">and tv.f_ETD = #{fEtd}</if>
+            <if test="fAtd != null ">and tv.f_ATD = #{fAtd}</if>
+            <if test="fEta != null ">and tv.f_ETA = #{fEta}</if>
+            <if test="fAta != null ">and tv.f_ATA = #{fAta}</if>
+            <if test="fDays != null ">and tv.f_days = #{fDays}</if>
+            <if test="fDucomentrayoffdate != null ">and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
+            <if test="fCutoffdate != null ">and tv.f_cutoffdate = #{fCutoffdate}</if>
+            <if test="fTeu != null  and fTeu != ''">and tv.f_teu = #{fTeu}</if>
+            <if test="fManageid != null ">and tv.f_manageid = #{fManageid}</if>
+            <if test="fTel != null  and fTel != ''">and tv.f_tel = #{fTel}</if>
+            <if test="fStatus != null  and fStatus != ''">and tv.f_status = #{fStatus}</if>
             <if test="createBy != null  and createBy != ''">and tv.create_by like concat('%', #{createBy}, '%')</if>
             <if test="remark != null  and remark != ''">and tv.remark like concat('%', #{remark}, '%')</if>
-            <if test="pidName != null  and pidName != ''"> and te.f_name = #{pidName}</if>
-            <if test="portofloadidName != null  and portofloadidName != ''"> and ta.f_name = #{portofloadidName}</if>
-            <if test="portofdischargeidName != null  and portofdischargeidName != ''"> and td.f_name = #{portofdischargeidName}</if>
-            <if test="distinationidName != null  and distinationidName != ''"> and tr.f_name = #{distinationidName}</if>
-            <if test="portoftransshipmentName != null  and portoftransshipmentName != ''"> and ts.f_name = #{portoftransshipmentName}</if>
+            <if test="pidName != null  and pidName != ''">and te.f_name = #{pidName}</if>
+            <if test="portofloadidName != null  and portofloadidName != ''">and ta.f_name = #{portofloadidName}</if>
+            <if test="portofdischargeidName != null  and portofdischargeidName != ''">and td.f_name =
+                #{portofdischargeidName}
+            </if>
+            <if test="distinationidName != null  and distinationidName != ''">and tr.f_name = #{distinationidName}</if>
+            <if test="portoftransshipmentName != null  and portoftransshipmentName != ''">and ts.f_name =
+                #{portoftransshipmentName}
+            </if>
             <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
                 and tv.create_time &gt;= #{cLoadDate[0]}
             </if>
             <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
                 and tv.create_time &lt;= #{cLoadDate[1]}
             </if>
-            <if test="fLaneid != null "> and f_laneid = #{fLaneid}</if>
+            <if test="fLaneid != null ">and f_laneid = #{fLaneid}</if>
         </where>
     </select>
     <select id="selectMessage" parameterType="TVoyage" resultMap="TVoyageResult">
@@ -163,44 +167,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN t_address td ON tv.f_portofdischargeid = td.f_id
         LEFT JOIN t_address tr ON tv.f_distinationid = tr.f_id
         LEFT JOIN t_address ts ON tv.f_portoftransshipment = ts.f_id
-        LEFT JOIN sys_user  su ON tv.f_manageid = su.user_id
+        LEFT JOIN sys_user su ON tv.f_manageid = su.user_id
         <where>
             tv.f_status = 'T'
             AND (date(tv.f_ATD) >= DATE_SUB(CURDATE(), INTERVAL 2 DAY)
             OR tv.f_ATD IS NULL)
-            <if test="fId != null "> and tv.f_id = #{fId}</if>
-            <if test="fPid != null "> and tv.f_pid = #{fPid}</if>
-            <if test="fNo != null  and fNo != ''"> and tv.f_no = #{fNo}</if>
-            <if test="fPortofloadid != null "> and tv.f_portofloadid = #{fPortofloadid}</if>
-            <if test="fPortofdischargeid != null "> and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
-            <if test="fDistinationid != null "> and tv.f_distinationid = #{fDistinationid}</if>
-            <if test="fPortoftransshipment != null "> and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
-            <if test="fPortoftransshipment == null and empty != null"> and tv.f_portoftransshipment IS NULL</if>
-            <if test="fEtd != null "> and tv.f_ETD = #{fEtd}</if>
-            <if test="fAtd != null "> and tv.f_ATD = #{fAtd}</if>
-            <if test="fEta != null "> and tv.f_ETA = #{fEta}</if>
-            <if test="fAta != null "> and tv.f_ATA = #{fAta}</if>
-            <if test="fDays != null "> and tv.f_days = #{fDays}</if>
-            <if test="fDucomentrayoffdate != null "> and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
-            <if test="fCutoffdate != null "> and tv.f_cutoffdate = #{fCutoffdate}</if>
-            <if test="fTeu != null  and fTeu != ''"> and tv.f_teu = #{fTeu}</if>
-            <if test="fManageid != null "> and tv.f_manageid = #{fManageid}</if>
-            <if test="fTel != null  and fTel != ''"> and tv.f_tel = #{fTel}</if>
-            <if test="fStatus != null  and fStatus != ''"> and tv.f_status = #{fStatus}</if>
+            <if test="fId != null ">and tv.f_id = #{fId}</if>
+            <if test="fPid != null ">and tv.f_pid = #{fPid}</if>
+            <if test="fNo != null  and fNo != ''">and tv.f_no = #{fNo}</if>
+            <if test="fPortofloadid != null ">and tv.f_portofloadid = #{fPortofloadid}</if>
+            <if test="fPortofdischargeid != null ">and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
+            <if test="fDistinationid != null ">and tv.f_distinationid = #{fDistinationid}</if>
+            <if test="fPortoftransshipment != null ">and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
+            <if test="fPortoftransshipment == null and empty != null">and tv.f_portoftransshipment IS NULL</if>
+            <if test="fEtd != null ">and tv.f_ETD = #{fEtd}</if>
+            <if test="fAtd != null ">and tv.f_ATD = #{fAtd}</if>
+            <if test="fEta != null ">and tv.f_ETA = #{fEta}</if>
+            <if test="fAta != null ">and tv.f_ATA = #{fAta}</if>
+            <if test="fDays != null ">and tv.f_days = #{fDays}</if>
+            <if test="fDucomentrayoffdate != null ">and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
+            <if test="fCutoffdate != null ">and tv.f_cutoffdate = #{fCutoffdate}</if>
+            <if test="fTeu != null  and fTeu != ''">and tv.f_teu = #{fTeu}</if>
+            <if test="fManageid != null ">and tv.f_manageid = #{fManageid}</if>
+            <if test="fTel != null  and fTel != ''">and tv.f_tel = #{fTel}</if>
+            <if test="fStatus != null  and fStatus != ''">and tv.f_status = #{fStatus}</if>
             <if test="createBy != null  and createBy != ''">and tv.create_by like concat('%', #{createBy}, '%')</if>
             <if test="remark != null  and remark != ''">and tv.remark like concat('%', #{remark}, '%')</if>
-            <if test="pidName != null  and pidName != ''"> and te.f_name = #{pidName}</if>
-            <if test="portofloadidName != null  and portofloadidName != ''"> and ta.f_name = #{portofloadidName}</if>
-            <if test="portofdischargeidName != null  and portofdischargeidName != ''"> and td.f_name = #{portofdischargeidName}</if>
-            <if test="distinationidName != null  and distinationidName != ''"> and tr.f_name = #{distinationidName}</if>
-            <if test="portoftransshipmentName != null  and portoftransshipmentName != ''"> and ts.f_name = #{portoftransshipmentName}</if>
+            <if test="pidName != null  and pidName != ''">and te.f_name = #{pidName}</if>
+            <if test="portofloadidName != null  and portofloadidName != ''">and ta.f_name = #{portofloadidName}</if>
+            <if test="portofdischargeidName != null  and portofdischargeidName != ''">and td.f_name =
+                #{portofdischargeidName}
+            </if>
+            <if test="distinationidName != null  and distinationidName != ''">and tr.f_name = #{distinationidName}</if>
+            <if test="portoftransshipmentName != null  and portoftransshipmentName != ''">and ts.f_name =
+                #{portoftransshipmentName}
+            </if>
             <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
                 and tv.create_time &gt;= #{cLoadDate[0]}
             </if>
             <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
                 and tv.create_time &lt;= #{cLoadDate[1]}
             </if>
-            <if test="fLaneid != null "> and f_laneid = #{fLaneid}</if>
+            <if test="fLaneid != null ">and f_laneid = #{fLaneid}</if>
         </where>
     </select>
     <select id="selectTVoyageListNew" parameterType="TVoyage" resultMap="TVoyageResult">
@@ -247,43 +255,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN t_address td ON tv.f_portofdischargeid = td.f_id
         LEFT JOIN t_address tr ON tv.f_distinationid = tr.f_id
         LEFT JOIN t_address ts ON tv.f_portoftransshipment = ts.f_id
-        LEFT JOIN sys_user  su ON tv.f_manageid = su.user_id
+        LEFT JOIN sys_user su ON tv.f_manageid = su.user_id
         <where>
             tv.f_status = 'T'
             AND (date(tv.f_ATD) >= DATE_SUB(CURDATE(), INTERVAL 2 DAY)
             OR tv.f_ATD IS NULL)
-            <if test="fPid != null "> and tv.f_pid = #{fPid}</if>
-            <if test="fNo != null  and fNo != ''"> and tv.f_no = #{fNo}</if>
-            <if test="fPortofloadid != null "> and tv.f_portofloadid = #{fPortofloadid}</if>
-            <if test="fPortofdischargeid != null "> and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
-            <if test="fDistinationid != null "> and tv.f_distinationid = #{fDistinationid}</if>
-            <if test="fPortoftransshipment != null "> and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
-            <if test="fPortoftransshipment == null and empty != null"> and tv.f_portoftransshipment IS NULL</if>
-            <if test="fEtd != null "> and tv.f_ETD = #{fEtd}</if>
-            <if test="fAtd != null "> and tv.f_ATD = #{fAtd}</if>
-            <if test="fEta != null "> and tv.f_ETA = #{fEta}</if>
-            <if test="fAta != null "> and tv.f_ATA = #{fAta}</if>
-            <if test="fDays != null "> and tv.f_days = #{fDays}</if>
-            <if test="fDucomentrayoffdate != null "> and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
-            <if test="fCutoffdate != null "> and tv.f_cutoffdate = #{fCutoffdate}</if>
-            <if test="fTeu != null  and fTeu != ''"> and tv.f_teu = #{fTeu}</if>
-            <if test="fManageid != null "> and tv.f_manageid = #{fManageid}</if>
-            <if test="fTel != null  and fTel != ''"> and tv.f_tel = #{fTel}</if>
-            <if test="fStatus != null  and fStatus != ''"> and tv.f_status = #{fStatus}</if>
+            <if test="fPid != null ">and tv.f_pid = #{fPid}</if>
+            <if test="fNo != null  and fNo != ''">and tv.f_no = #{fNo}</if>
+            <if test="fPortofloadid != null ">and tv.f_portofloadid = #{fPortofloadid}</if>
+            <if test="fPortofdischargeid != null ">and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
+            <if test="fDistinationid != null ">and tv.f_distinationid = #{fDistinationid}</if>
+            <if test="fPortoftransshipment != null ">and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
+            <if test="fPortoftransshipment == null and empty != null">and tv.f_portoftransshipment IS NULL</if>
+            <if test="fEtd != null ">and tv.f_ETD = #{fEtd}</if>
+            <if test="fAtd != null ">and tv.f_ATD = #{fAtd}</if>
+            <if test="fEta != null ">and tv.f_ETA = #{fEta}</if>
+            <if test="fAta != null ">and tv.f_ATA = #{fAta}</if>
+            <if test="fDays != null ">and tv.f_days = #{fDays}</if>
+            <if test="fDucomentrayoffdate != null ">and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
+            <if test="fCutoffdate != null ">and tv.f_cutoffdate = #{fCutoffdate}</if>
+            <if test="fTeu != null  and fTeu != ''">and tv.f_teu = #{fTeu}</if>
+            <if test="fManageid != null ">and tv.f_manageid = #{fManageid}</if>
+            <if test="fTel != null  and fTel != ''">and tv.f_tel = #{fTel}</if>
+            <if test="fStatus != null  and fStatus != ''">and tv.f_status = #{fStatus}</if>
             <if test="createBy != null  and createBy != ''">and tv.create_by like concat('%', #{createBy}, '%')</if>
             <if test="remark != null  and remark != ''">and tv.remark like concat('%', #{remark}, '%')</if>
-            <if test="pidName != null  and pidName != ''"> and te.f_name = #{pidName}</if>
-            <if test="portofloadidName != null  and portofloadidName != ''"> and ta.f_name = #{portofloadidName}</if>
-            <if test="portofdischargeidName != null  and portofdischargeidName != ''"> and td.f_name = #{portofdischargeidName}</if>
-            <if test="distinationidName != null  and distinationidName != ''"> and tr.f_name = #{distinationidName}</if>
-            <if test="portoftransshipmentName != null  and portoftransshipmentName != ''"> and ts.f_name = #{portoftransshipmentName}</if>
+            <if test="pidName != null  and pidName != ''">and te.f_name = #{pidName}</if>
+            <if test="portofloadidName != null  and portofloadidName != ''">and ta.f_name = #{portofloadidName}</if>
+            <if test="portofdischargeidName != null  and portofdischargeidName != ''">and td.f_name =
+                #{portofdischargeidName}
+            </if>
+            <if test="distinationidName != null  and distinationidName != ''">and tr.f_name = #{distinationidName}</if>
+            <if test="portoftransshipmentName != null  and portoftransshipmentName != ''">and ts.f_name =
+                #{portoftransshipmentName}
+            </if>
             <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
                 and tv.create_time &gt;= #{cLoadDate[0]}
             </if>
             <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
                 and tv.create_time &lt;= #{cLoadDate[1]}
             </if>
-            <if test="fLaneid != null "> and f_laneid = #{fLaneid}</if>
+            <if test="fLaneid != null ">and f_laneid = #{fLaneid}</if>
         </where>
     </select>
 
@@ -361,7 +373,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
             <if test="fLaneid != null">f_laneid,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fPid != null">#{fPid},</if>
             <if test="fNo != null and fNo != ''">#{fNo},</if>
@@ -386,7 +398,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
             <if test="fLaneid != null">#{fLaneid},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateTVoyage" parameterType="TVoyage">
@@ -440,32 +452,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE
 	        f_no = #{fNo}
     </select>
-    <select id="selectTVoyagefNumber"  resultType="map">
+    <select id="selectTVoyagefNumber" resultType="map">
         SELECT
-	        f_id fId,
-	        f_no fNo
+        f_id fId,
+        f_no fNo
         FROM
-	        t_voyage
+        t_voyage
         WHERE
-	        f_status = 'T'
-        <if test="fPid != null "> and f_pid = #{fPid}</if>
-        <if test="fNo != null  and fNo != ''"> and f_no = #{fNo}</if>
-        <if test="fPortofloadid != null "> and f_portofloadid = #{fPortofloadid}</if>
-        <if test="fPortofdischargeid != null "> and f_portofdischargeid = #{fPortofdischargeid}</if>
-        <if test="fDistinationid != null "> and f_distinationid = #{fDistinationid}</if>
-        <if test="fPortoftransshipment != null "> and f_portoftransshipment = #{fPortoftransshipment}</if>
-        <if test="fEtd != null "> and f_ETD = #{fEtd}</if>
-        <if test="fAtd != null "> and f_ATD = #{fAtd}</if>
-        <if test="fEta != null "> and f_ETA = #{fEta}</if>
-        <if test="fAta != null "> and f_ATA = #{fAta}</if>
-        <if test="fDays != null "> and f_days = #{fDays}</if>
-        <if test="fDucomentrayoffdate != null "> and f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
-        <if test="fCutoffdate != null "> and f_cutoffdate = #{fCutoffdate}</if>
-        <if test="fTeu != null  and fTeu != ''"> and f_teu = #{fTeu}</if>
-        <if test="fManageid != null "> and f_manageid = #{fManageid}</if>
-        <if test="fTel != null  and fTel != ''"> and f_tel = #{fTel}</if>
-        <if test="fStatus != null  and fStatus != ''"> and f_status = #{fStatus}</if>
-        <if test="fLaneid != null "> and f_laneid = #{fLaneid}</if>
+        f_status = 'T'
+        <if test="fPid != null ">and f_pid = #{fPid}</if>
+        <if test="fNo != null  and fNo != ''">and f_no = #{fNo}</if>
+        <if test="fPortofloadid != null ">and f_portofloadid = #{fPortofloadid}</if>
+        <if test="fPortofdischargeid != null ">and f_portofdischargeid = #{fPortofdischargeid}</if>
+        <if test="fDistinationid != null ">and f_distinationid = #{fDistinationid}</if>
+        <if test="fPortoftransshipment != null ">and f_portoftransshipment = #{fPortoftransshipment}</if>
+        <if test="fEtd != null ">and f_ETD = #{fEtd}</if>
+        <if test="fAtd != null ">and f_ATD = #{fAtd}</if>
+        <if test="fEta != null ">and f_ETA = #{fEta}</if>
+        <if test="fAta != null ">and f_ATA = #{fAta}</if>
+        <if test="fDays != null ">and f_days = #{fDays}</if>
+        <if test="fDucomentrayoffdate != null ">and f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
+        <if test="fCutoffdate != null ">and f_cutoffdate = #{fCutoffdate}</if>
+        <if test="fTeu != null  and fTeu != ''">and f_teu = #{fTeu}</if>
+        <if test="fManageid != null ">and f_manageid = #{fManageid}</if>
+        <if test="fTel != null  and fTel != ''">and f_tel = #{fTel}</if>
+        <if test="fStatus != null  and fStatus != ''">and f_status = #{fStatus}</if>
+        <if test="fLaneid != null ">and f_laneid = #{fLaneid}</if>
     </select>
     <!--查询航次信息是否重复-->
     <select id="selectTVoyageMessage" parameterType="Long" resultMap="TVoyageResult">
@@ -474,8 +486,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and f_portofloadid = #{fPortofloadid}
         and f_distinationid = #{fDistinationid}
         and f_ETD = #{fEtd}
-        <if test="fPortoftransshipment != null "> and f_portoftransshipment = #{fPortoftransshipment}</if>
-        <if test="fPortoftransshipment == null "> and f_portoftransshipment IS NULL</if>
+        <if test="fPortoftransshipment != null ">and f_portoftransshipment = #{fPortoftransshipment}</if>
+        <if test="fPortoftransshipment == null ">and f_portoftransshipment IS NULL</if>
     </select>
     <select id="selectTVoyageIds" parameterType="TVoyage" resultType="long">
         SELECT
@@ -486,10 +498,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             tv.f_status = 'T'
             AND (date(tv.f_ATD) >= DATE_SUB(CURDATE(), INTERVAL 2 DAY)
             OR tv.f_ATD IS NULL)
-            <if test="fPortofloadid != null "> and tv.f_portofloadid = #{fPortofloadid}</if>
-            <if test="fDistinationid != null "> and tv.f_distinationid = #{fDistinationid}</if>
-            <if test="fPortoftransshipment != null "> and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
-            <if test="fPortoftransshipment == null"> and tv.f_portoftransshipment IS NULL</if>
+            <if test="fPortofloadid != null ">and tv.f_portofloadid = #{fPortofloadid}</if>
+            <if test="fDistinationid != null ">and tv.f_distinationid = #{fDistinationid}</if>
+            <if test="fPortoftransshipment != null ">and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
+            <if test="fPortoftransshipment == null">and tv.f_portoftransshipment IS NULL</if>
         </where>
     </select>
     <select id="selectTVoyageByFid" parameterType="TVoyage" resultMap="TVoyageResult">
@@ -560,5 +572,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND tv.f_id = #{fId}
         </where>
     </select>
+    <select id="shipDynamic" resultType="map">
+        SELECT
+ta.fName fName, /*船名*/
+ta.fNo fNo,/*航次*/
+ta.portofloadName portofloadName,/*起运港*/
+ta.distinationName distinationName,/*目的港*/
+IFNULL(ta.fWeight,0) fWeight,/*容量*/
+IFNULL(tb.boxNumber,0) boxNumber,/*实际容量*/
+ta.fETD fETD,/*预计开船*/
+ta.fETA fETA,/*预计到港*/
+ta.fATD fATD,/*实际开船*/
+ta.fATA fATA,/*实际到港*/
+ta.fDays fDays/*航程*/
+FROM
+(
+SELECT
+tv.f_name fName, /*船名*/
+ty.f_no fNo,/*航次*/
+ta.f_name portofloadName,/*起运港*/
+tr.f_name distinationName,/*目的港*/
+tv.f_weight fWeight,/*容量*/
+ty.f_ETD fETD,/*预计开船*/
+ty.f_ETA fETA,/*预计到港*/
+ty.f_ATD fATD,/*实际开船*/
+ty.f_ATA fATA,/*实际到港*/
+ty.f_days fDays,/*航程*/
+ty.f_id voyid,/*航线ID*/
+tv.f_id vslid/*航ID*/
+FROM
+t_voyage ty
+LEFT JOIN t_vessel tv ON ty.f_pid = tv.f_id
+LEFT JOIN t_address ta ON ty.f_portofloadid = ta.f_id
+LEFT JOIN t_address tr ON ty.f_distinationid = tr.f_id
+)ta
+LEFT JOIN
+(
+SELECT
+tc.vesselName,
+tc.voyageName,
+SUM(tc.boxNumber)boxNumber
+FROM
+(
+SELECT
+tc.f_cntrno fCntrno,
+tr.f_no fNo,
+tw.f_vslid vesselName,
+tw.f_voyid voyageName,
+CASE
+	WHEN SUBSTR(tr.f_no,1,2) = '20' THEN 1
+	WHEN  SUBSTR(tr.f_no,1,2) ='40' THEN 2
+	ELSE 0
+	END AS boxNumber
+FROM
+t_warehousebills_cntritems tc
+LEFT JOIN t_cntrno tn ON tn.f_no = tc.f_cntrno
+LEFT JOIN t_cntr tr ON tn.f_typeid = tr.f_id
+LEFT JOIN t_warehousebills tw ON tw.f_id = tc.f_pid
+WHERE tr.f_no IS NOT NULL
+)tc
+GROUP BY tc.vesselName,tc.voyageName
+)tb
+ON ta.voyid = tb.voyageName AND ta.vslid = tb.vesselName
+    </select>
 
 </mapper>

+ 39 - 0
ruoyi-shipping/src/main/resources/mapper/shipping/TWarehousebillsCntritemsMapper.xml

@@ -201,5 +201,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{fPid}
         </foreach>
     </delete>
+    <select id="bookingSpace" resultType="map">
+        SELECT
+	CASE MONTH(tc.createTime) WHEN '1' THEN SUM(tc.number) ELSE 0 END AS January,
+	 CASE MONTH(tc.createTime) WHEN '2' THEN SUM(tc.number) ELSE 0 END AS February,
+	 CASE MONTH(tc.createTime) WHEN '3' THEN SUM(tc.number) ELSE 0 END AS March,
+	 CASE MONTH(tc.createTime) WHEN '4' THEN SUM(tc.number) ELSE 0 END AS April,
+	 CASE MONTH(tc.createTime) WHEN '5' THEN SUM(tc.number) ELSE 0 END AS May,
+	 CASE MONTH(tc.createTime) WHEN '6' THEN SUM(tc.number) ELSE 0 END AS June,
+	 CASE MONTH(tc.createTime) WHEN '7' THEN SUM(tc.number) ELSE 0 END AS July,
+	 CASE MONTH(tc.createTime) WHEN '8' THEN SUM(tc.number) ELSE 0 END AS August,
+	 CASE MONTH(tc.createTime) WHEN '9' THEN SUM(tc.number) ELSE 0 END AS September,
+	 CASE MONTH(tc.createTime) WHEN '10' THEN SUM(tc.number) ELSE 0 END AS October,
+	 CASE MONTH(tc.createTime) WHEN '11' THEN SUM(tc.number) ELSE 0 END AS November,
+	 CASE MONTH(tc.createTime) WHEN '12' THEN SUM(tc.number) ELSE 0 END AS December,
+	 tp.f_name corpName
+FROM
+(
+SELECT
+	tc.f_cntrno fCntrno,
+	tc.create_time createTime,
+	tw.f_corpid fCorpid,
+	tn.f_no,
+	CASE
+	WHEN SUBSTR(tn.f_no,1,2) = '20' THEN 1
+	WHEN  SUBSTR(tn.f_no,1,2) ='40' THEN 2
+	ELSE 0
+	END AS number
+FROM
+	t_warehousebills_cntritems tc
+	LEFT JOIN t_warehousebills tw ON tc.f_pid = tw.f_id
+	LEFT JOIN t_cntrno tr ON tc.f_cntrno = tr.f_no
+	LEFT JOIN t_cntr tn ON tr.f_typeid = tn.f_id
+	WHERE tw.f_corpid IS NOT NULL
+	AND tn.f_no IS NOT NULL
+	AND YEAR(tc.create_time) = YEAR(NOW())
+	)tc
+	LEFT JOIN t_corps tp ON tc.fCorpid = tp.f_id
+	GROUP BY tc.fCorpid
+    </select>
     
 </mapper>

+ 6 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsfeesMapper.java

@@ -135,4 +135,10 @@ public interface TWarehousebillsfeesMapper extends BaseMapper<TWarehousebillsfee
      */
     public List<Long> selectTWarehousebillsfeesSrcId(Long fId);
 
+    /**
+     * 首页应收款排名
+     * @return
+     */
+    public List<Map<String,Object>> accountsDue();
+
 }

+ 6 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehousebillsfeesService.java

@@ -5,6 +5,7 @@ import com.ruoyi.finance.excel.FleetExcel;
 import com.ruoyi.warehouseBusiness.domain.TWarehousebillsfees;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 仓库费用明细Service接口
@@ -74,4 +75,9 @@ public interface ITWarehousebillsfeesService {
      * @return
      */
     public List<String> selectFleetExcel(List<FleetExcel> fleetExcelsList);
+    /**
+     * 首页应收款排名
+     * @return
+     */
+    public List<Map<String,Object>> accountsDue();
 }

+ 6 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehousebillsfeesServiceImpl.java

@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 仓库费用明细Service业务层处理
@@ -176,4 +177,9 @@ public class TWarehousebillsfeesServiceImpl implements ITWarehousebillsfeesServi
         stringList.add(totalAmount + "");
         return stringList;
     }
+
+    @Override
+    public List<Map<String, Object>> accountsDue() {
+        return tWarehousebillsfeesMapper.accountsDue();
+    }
 }

+ 23 - 0
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

@@ -784,4 +784,27 @@
         where f_pid = #{fId}
           AND src_id IS NOT NULL
     </select>
+    <select id="accountsDue" resultType="map">
+        SELECT
+	 CASE MONTH(tf.create_time) WHEN '1' THEN SUM(tf.f_amount) ELSE 0 END AS January,
+	 CASE MONTH(tf.create_time) WHEN '2' THEN SUM(tf.f_amount) ELSE 0 END AS February,
+	 CASE MONTH(tf.create_time) WHEN '3' THEN SUM(tf.f_amount) ELSE 0 END AS March,
+	 CASE MONTH(tf.create_time) WHEN '4' THEN SUM(tf.f_amount) ELSE 0 END AS April,
+	 CASE MONTH(tf.create_time) WHEN '5' THEN SUM(tf.f_amount) ELSE 0 END AS May,
+	 CASE MONTH(tf.create_time) WHEN '6' THEN SUM(tf.f_amount) ELSE 0 END AS June,
+	 CASE MONTH(tf.create_time) WHEN '7' THEN SUM(tf.f_amount) ELSE 0 END AS July,
+	 CASE MONTH(tf.create_time) WHEN '8' THEN SUM(tf.f_amount) ELSE 0 END AS August,
+	 CASE MONTH(tf.create_time) WHEN '9' THEN SUM(tf.f_amount) ELSE 0 END AS September,
+	 CASE MONTH(tf.create_time) WHEN '10' THEN SUM(tf.f_amount) ELSE 0 END AS October,
+	 CASE MONTH(tf.create_time) WHEN '11' THEN SUM(tf.f_amount) ELSE 0 END AS November,
+	 CASE MONTH(tf.create_time) WHEN '12' THEN SUM(tf.f_amount) ELSE 0 END AS December,
+	 tc.f_name corpName
+FROM
+	t_warehousebillsfees tf
+	LEFT JOIN t_corps tc ON tf.f_corpid = tc.f_id
+	WHERE ifnull(tf.f_amount, 0) - ifnull(tf.f_stlamount, 0) >0
+	AND tf.f_dc = 'D'
+	AND YEAR(tf.create_time) = YEAR(NOW())
+	GROUP BY tf.f_corpid
+    </select>
 </mapper>