Browse Source

Merge remote-tracking branch 'origin/dev' into dev

lazhaoqian 4 years ago
parent
commit
8fd6808769
27 changed files with 705 additions and 217 deletions
  1. 50 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/HomePage.java
  2. 5 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/TCntrnoController.java
  3. 10 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWhgenlegController.java
  4. 1 1
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TCntrno.java
  5. 28 7
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/excel/AirForceStationExcel.java
  6. 8 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TCntrnoMapper.java
  7. 6 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TVoyageMapper.java
  8. 8 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TWarehousebillsCntritemsMapper.java
  9. 5 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITCntrService.java
  10. 6 1
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITCntrnoService.java
  11. 5 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITVoyageService.java
  12. 7 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITWarehousebillsCntritemsService.java
  13. 5 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TCntrServiceImpl.java
  14. 171 56
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TCntrnoServiceImpl.java
  15. 5 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TVoyageServiceImpl.java
  16. 7 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TWarehousebillsCntritemsServiceImpl.java
  17. 1 1
      ruoyi-shipping/src/main/resources/mapper/shipping/TCntrMapper.xml
  18. 46 14
      ruoyi-shipping/src/main/resources/mapper/shipping/TCntrnoMapper.xml
  19. 210 134
      ruoyi-shipping/src/main/resources/mapper/shipping/TVoyageMapper.xml
  20. 41 0
      ruoyi-shipping/src/main/resources/mapper/shipping/TWarehousebillsCntritemsMapper.xml
  21. 10 0
      ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/domain/TWhgenleg.java
  22. 6 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsfeesMapper.java
  23. 6 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehousebillsfeesService.java
  24. 24 2
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java
  25. 6 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehousebillsfeesServiceImpl.java
  26. 4 0
      ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml
  27. 24 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());
+    }
+}

+ 5 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/TCntrnoController.java

@@ -13,6 +13,7 @@ import com.ruoyi.framework.web.service.TokenService;
 import com.ruoyi.shipping.excel.AirForceStationExcel;
 import com.ruoyi.shipping.excel.BoxDistributionStatistics;
 import com.ruoyi.shipping.excel.TCntrnoExcel;
+import com.ruoyi.shipping.service.ITCntrService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -39,6 +40,8 @@ public class TCntrnoController extends BaseController
 {
     @Autowired
     private ITCntrnoService tCntrnoService;
+    @Autowired
+    private ITCntrService itCntrService;
 
     /**
      * 查询集装箱号列表
@@ -159,8 +162,9 @@ public class TCntrnoController extends BaseController
     @GetMapping("/getTCntrnoMessage")
     public TableDataInfo getTCntrnoMessage(TCntrno tCntrno)
     {
+        List<String> stringList = itCntrService.selectTCntrFNo();
         startPage();
-        List<Map<String, Object>> list = tCntrnoService.getTCntrnoMessage(tCntrno);
+        List<Map<String, Object>> list = tCntrnoService.getTCntrnoMessage(tCntrno,stringList);
         return getDataTable(list);
     }
     /**

+ 10 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWhgenlegController.java

@@ -238,6 +238,16 @@ public class TWhgenlegController extends BaseController {
         List<Map<String, Object>> list = tWhgenlegService.getWarehouse(tWhgenleg);
         return AjaxResult.success(list);
     }
+    /**
+     * 网站查询库存总账列表
+     */
+    @DataScope(deptAlias = "d", userAlias = "u")
+    @GetMapping("/websiteWhGenLegList")
+    public TableDataInfo websiteWhGenLegList(TWhgenleg tWhgenleg) {
+        startPage();
+        List<Map<String, Object>> list = tWhgenlegService.selectInventoryMapList(tWhgenleg);
+        return getDataTable(list);
+    }
 
 
 

+ 1 - 1
ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TCntrno.java

@@ -95,7 +95,7 @@ public class TCntrno extends BaseEntity
     private String fRent;
 
     /** 最新时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     //@Excel(name = "最新时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date fUpdatetime;
     /** 造箱时间 */

+ 28 - 7
ruoyi-shipping/src/main/java/com/ruoyi/shipping/excel/AirForceStationExcel.java

@@ -16,9 +16,18 @@ public class AirForceStationExcel {
     //箱号
     @Excel(name = "箱号")
     private String fNo;
+    //空重中文
+    @Excel(name = "空重")
+    private String updateEFName;
     //动态日期
     @Excel(name = "动态日期")
     private Date updateTime;
+    //港口名称
+    @Excel(name = "地点类型 如: 堆场,码头")
+    private String portName;
+    //堆放地点
+    @Excel(name = "堆放地点")
+    private String fUpdateaddress;
     //船名
     @Excel(name = "船名")
     private String fVsl;
@@ -28,12 +37,6 @@ public class AirForceStationExcel {
     //重量
     @Excel(name = "重量")
     private String fBoxWeight;
-    //港口名称
-    @Excel(name = "港口名称")
-    private String portName;
-    //堆放地点
-    @Excel(name = "堆放地点")
-    private String fUpdateaddress;
     //提单号
     @Excel(name = "提单号")
     private String fMblno;
@@ -41,12 +44,28 @@ public class AirForceStationExcel {
     @Excel(name = "铅封号")
     private String fSealno;
     //是否箱损
-    @Excel(name = "是否箱损")
+    @Excel(name = "是否箱损 如:好,坏")
     private String fCntrstatus;
     //箱损描述
     @Excel(name = "箱损描述(备注)")
     private String remark;
 
+    public String getPortName() {
+        return portName;
+    }
+
+    public void setPortName(String portName) {
+        this.portName = portName;
+    }
+
+    public String getUpdateEFName() {
+        return updateEFName;
+    }
+
+    public void setUpdateEFName(String updateEFName) {
+        this.updateEFName = updateEFName;
+    }
+
     public String getfOpctnstatus() {
         return fOpctnstatus;
     }
@@ -149,6 +168,8 @@ public class AirForceStationExcel {
                 ", fSealno='" + fSealno + '\'' +
                 ", fCntrstatus='" + fCntrstatus + '\'' +
                 ", remark='" + remark + '\'' +
+                ", updateEFName='" + updateEFName + '\'' +
+                ", portName='" + portName + '\'' +
                 '}';
     }
 }

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

@@ -105,6 +105,8 @@ public interface TCntrnoMapper
      * @return
      */
     public List<Map<String, Object>> getTCntrnoMessage(@Param("sql") String sql,
+                                                       @Param("stand") String stand,
+                                                       @Param("bareWeight") String bareWeight,
                                                        @Param("tCntrno") TCntrno tCntrno);
 
     /**
@@ -153,4 +155,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/ITCntrService.java

@@ -80,4 +80,9 @@ public interface ITCntrService
      * @return
      */
     public String selectTcnrFName(TCntr tCntr);
+    /**
+     * 获取集装箱的编号
+     * @return
+     */
+    public  List<String> selectTCntrFNo();
 }

+ 6 - 1
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/ITCntrnoService.java

@@ -97,7 +97,7 @@ public interface ITCntrnoService
      * @param tCntrno
      * @return
      */
-    public List<Map<String, Object>> getTCntrnoMessage(TCntrno tCntrno);
+    public List<Map<String, Object>> getTCntrnoMessage(TCntrno tCntrno,List<String> list );
     /**
      * 获取集装箱分布信息
      * @param tCntrno
@@ -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/TCntrServiceImpl.java

@@ -124,4 +124,9 @@ public class TCntrServiceImpl implements ITCntrService
         return UserConstants.UNIQUE;
 
     }
+
+    @Override
+    public List<String> selectTCntrFNo() {
+        return tCntrMapper.selectTCntrFNo();
+    }
 }

+ 171 - 56
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TCntrnoServiceImpl.java

@@ -275,18 +275,33 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
     }
 
     @Override
-    public List<Map<String, Object>> getTCntrnoMessage(TCntrno tCntrno) {
-        StringBuffer stringBuffer = new StringBuffer();
-        List<String> list = tCntrMapper.selectTCntrFNo();
-        String sql = null;
+    public List<Map<String, Object>> getTCntrnoMessage(TCntrno tCntrno,List<String> list ) {
+        List<Map<String, Object>> mapList = new ArrayList<>();
+        StringBuffer stringBuffer = new StringBuffer();//查类型数据
+        StringBuffer standBuffer = new StringBuffer();//查空重
+        StringBuffer bareWeightBuffer = new StringBuffer();//查好坏
+        String sql = null;//查类型数据
+        String stand = null;//查空重
+        String bareWeight = null;//查好坏
         if (CollectionUtils.isNotEmpty(list)) {
             for (String s : list) {
                 stringBuffer.append("MAX( CASE WHEN tt.f_no = '" + s);
                 stringBuffer.append("' THEN tt.typeidCount ELSE 0 END ) AS '" + s + "',");
+                standBuffer.append("MAX( CASE WHEN a.typeName ='"+s+"' AND a.dict_label = '空'");
+                standBuffer.append("THEN a.efCount ELSE 0 END ) AS '" + s + "空',");
+                standBuffer.append("MAX( CASE WHEN a.typeName ='"+s+"' AND a.dict_label = '重'");
+                standBuffer.append("THEN a.efCount ELSE 0 END ) AS '" + s + "重',");
+                bareWeightBuffer.append("MAX( CASE WHEN b.typeName ='"+s+"' AND b.dict_label = '好'");
+                bareWeightBuffer.append("THEN b.statusCount ELSE 0 END ) AS '" + s + "好',");
+                bareWeightBuffer.append("MAX( CASE WHEN b.typeName ='"+s+"' AND b.dict_label = '坏'");
+                bareWeightBuffer.append("THEN b.statusCount ELSE 0 END ) AS '" + s + "坏',");
             }
             sql = stringBuffer.subSequence(0, stringBuffer.length() - 1).toString();
+            stand = standBuffer.subSequence(0, standBuffer.length() - 1).toString();
+            bareWeight = bareWeightBuffer.subSequence(0, bareWeightBuffer.length() - 1).toString();
+            mapList = tCntrnoMapper.getTCntrnoMessage(sql,stand,bareWeight,tCntrno);
         }
-        return tCntrnoMapper.getTCntrnoMessage(sql, tCntrno);
+        return mapList;
     }
 
     @Override
@@ -298,6 +313,8 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
         String updateEFName = null;//空重
         if (StringUtils.isNotEmpty(tCntrno.getAddressName())) {
             address = tCntrno.getAddressName();
+        }else {
+            tCntrno.setfUpdateaddress("0");
         }
         if (StringUtils.isNotEmpty(tCntrno.getTypeidName())) {
             typeidName = tCntrno.getTypeidName();
@@ -318,11 +335,18 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
         List<String> key = new ArrayList<>();
         key.add("地点");
         List<String> list = tCntrMapper.selectTCntrFNo();
+        List<String> mapList = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(list)){
+            for (String s : list) {
+                mapList.add(s+"空");
+                mapList.add(s+"重");
+                mapList.add(s+"好");
+                mapList.add(s+"坏");
+            }
+        }
+        list.addAll(mapList);
+        Collections.sort(list);
         key.addAll(list);
-        key.add("空");
-        key.add("重");
-        key.add("好");
-        key.add("坏");
         return key;
     }
 
@@ -604,16 +628,34 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                             }
                             companyMsg.setfNo(cell.getStringCellValue());
                             break;
-                        case "动态日期":
+                        case "空重":
                             //设置单元格类型
                             cell.setCellType(CellType.STRING);
                             if (StringUtils.isEmpty(cell.getStringCellValue())) {
+                                return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少空重");
+                            }
+                            String fUpDaTeEf = sysDictDataMapper.selectDictValue("f_updateEF", cell.getStringCellValue());
+                            if (StringUtils.isEmpty(fUpDaTeEf)){
+                                return AjaxResult.error("系统缺少空重:"+cell.getStringCellValue()+"请维护");
+                            }
+                            companyMsg.setfUpdateef(fUpDaTeEf);
+                            companyMsg.setUpdateEFName(cell.getStringCellValue());
+                            break;
+                        case "动态日期":
+                            //设置单元格类型
+                            cell.setCellType(CellType.STRING);
+                            String dataFormatString = cell.getStringCellValue();
+                            if (StringUtils.isEmpty(dataFormatString)) {
                                 return AjaxResult.error("Excel箱信息数据第" + line + "行数据缺少动态日期");
                             }
-                            Date tDate = new Date();
-                            long localOffset = tDate.getTimezoneOffset() * 60000; //系统时区偏移 1900/1/1 到 1970/1/1 的 25569 天
-                            tDate.setTime((long) ((Double.valueOf(cell.getStringCellValue()) - 25569) * 24 * 3600 * 1000 + localOffset));
-                            companyMsg.setfUpdatetime(tDate);
+                            Date parse = new Date();
+                            try {
+                                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+                                parse = simpleDateFormat.parse(dataFormatString);
+                            }catch (Exception e){
+                                return AjaxResult.error("日期格式有误,正确格式如: 2021/9/2 15:11:22");
+                            }
+                            companyMsg.setfUpdatetime(parse);
                             break;
                         case "船名":
                             //设置单元格类型
@@ -640,7 +682,7 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                             BigDecimal bigDecimal = new BigDecimal(cell.getStringCellValue());
                             companyMsg.setfBoxWeight(bigDecimal);
                             break;
-                        case "港口名称":
+                        case "地点类型 如: 堆场,码头":
                             //设置单元格类型
                             cell.setCellType(CellType.STRING);
                             if (StringUtils.isEmpty(cell.getStringCellValue())) {
@@ -685,7 +727,7 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                             }*/
                             companyMsg.setfSealno(cell.getStringCellValue());
                             break;
-                        case "是否箱损":
+                        case "是否箱损 如:好,坏":
                             //设置单元格类型
                             cell.setCellType(CellType.STRING);
                             companyMsg.setCntrstatusName(cell.getStringCellValue());
@@ -719,6 +761,10 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
         List<TCntrno> addressMessageList = tCntrnoMapper.getBoxAddressMessage();
         //获取箱动态信息
         List<SysDictData> fOpcTnsTaTus = sysDictDataMapper.selectDictDataByType("f_opctnstatus");
+        //获取箱空重状态
+        List<SysDictData> fUpdateEF = sysDictDataMapper.selectDictDataByType("f_updateEF");
+        //获取箱好坏状态
+        List<SysDictData> fCnTrStatus = sysDictDataMapper.selectDictDataByType("f_cntrstatus");
         //在获取港口下的堆场对应的箱信息
         if (CollectionUtils.isNotEmpty(boxPortMessage) && CollectionUtils.isNotEmpty(fOpcTnsTaTus)){
             for (TCntrno cntrno : boxPortMessage) {
@@ -728,27 +774,20 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                 if (CollectionUtils.isNotEmpty(addressMessageList)){
                     for (TCntrno trno : addressMessageList) {
                         if (cntrno.getAddressName().equals(trno.getPortName()) && !trno.getAddressName().equals("在船")){
+                            List<BoxMessage> boxMessageList = new ArrayList<>();
                             BoxAddressMessage boxAddressMessage = new BoxAddressMessage();
                             boxAddressMessage.setAddress(trno.getAddressName());
-                            boxAddressMessage.setNumberSize(fOpcTnsTaTus.size());
-                            List<BoxMessage> boxMessageList = new ArrayList<>();
-                            for (SysDictData opcTnsTaTus : fOpcTnsTaTus) {
-                                TCntrno tro = new TCntrno();
-                                BoxMessage boxMessage = new BoxMessage();
-                                tro.setfUpdateaddress(trno.getfUpdateaddress());
-                                tro.setfOpctnstatus(opcTnsTaTus.getDictValue());
-                                BoxMessage message = tCntrnoMapper.boxDistributionStatistics(tro);
-                                if (message != null){
-                                    boxMessage = message;
-                                }
-                                boxMessage.setOpcTnStatus(opcTnsTaTus.getDictLabel());
-                                boxMessage.setUNIT(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
-                                            +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()+boxMessage.getFORTYGP()
-                                            +boxMessage.getFORTYHC()+boxMessage.getFORTYHR()+boxMessage.getFORTYOT()+boxMessage.getFORTYTK());
-                                boxMessage.setTEU(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
-                                            +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()*2+boxMessage.getFORTYGP()*2
-                                            +boxMessage.getFORTYHC()*2+boxMessage.getFORTYHR()*2+boxMessage.getFORTYOT()*2+boxMessage.getFORTYTK()*2);
-                                boxMessageList.add(boxMessage);
+                            boxAddressMessage.setNumberSize(fOpcTnsTaTus.size()+fUpdateEF.size()+fCnTrStatus.size());
+                            List<BoxMessage> opcTnsTaTus = this.getOpcTnsTaTus(fOpcTnsTaTus, trno);//获取调箱状态的箱新
+                            List<BoxMessage> updateEF = this.getUpdateEF(fUpdateEF, trno);//获取空重的箱信息
+                            List<BoxMessage> cnTrStatus = this.getCnTrStatus(fCnTrStatus, trno);//获取好坏的箱信息
+                            if (CollectionUtils.isNotEmpty(opcTnsTaTus)){
+                                boxMessageList.addAll(opcTnsTaTus);
+                            }
+                            if (CollectionUtils.isNotEmpty(updateEF)){
+                                boxMessageList.addAll(updateEF);
+                            }if (CollectionUtils.isNotEmpty(cnTrStatus)){
+                                boxMessageList.addAll(cnTrStatus);
                             }
                             boxAddressMessage.setBoxMessages(boxMessageList);
                             boxAddressMessageList.add(boxAddressMessage);
@@ -757,28 +796,20 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                             List<TCntrno> boxRemark = tCntrnoMapper.getBoxRemark(trno.getfUpdateaddress());
                             if (CollectionUtils.isNotEmpty(boxRemark)){
                                 for (TCntrno tCntrno : boxRemark) {
+                                    List<BoxMessage> boxMessageList = new ArrayList<>();
                                     BoxAddressMessage boxAddressMessage = new BoxAddressMessage();
                                     boxAddressMessage.setAddress(trno.getAddressName()+tCntrno.getRemark());
-                                    boxAddressMessage.setNumberSize(fOpcTnsTaTus.size());
-                                    List<BoxMessage> boxMessageList = new ArrayList<>();
-                                    for (SysDictData opcTnsTaTus : fOpcTnsTaTus) {
-                                        TCntrno tro = new TCntrno();
-                                        BoxMessage boxMessage = new BoxMessage();
-                                        tro.setfUpdateaddress(trno.getfUpdateaddress());
-                                        tro.setfOpctnstatus(opcTnsTaTus.getDictValue());
-                                        tro.setRemark(tCntrno.getRemark());
-                                        BoxMessage message = tCntrnoMapper.boxDistributionStatistics(tro);
-                                        if (message != null){
-                                            boxMessage = message;
-                                        }
-                                        boxMessage.setOpcTnStatus(opcTnsTaTus.getDictLabel());
-                                        boxMessage.setUNIT(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
-                                                +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()+boxMessage.getFORTYGP()
-                                                +boxMessage.getFORTYHC()+boxMessage.getFORTYHR()+boxMessage.getFORTYOT()+boxMessage.getFORTYTK());
-                                        boxMessage.setTEU(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
-                                                +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()*2+boxMessage.getFORTYGP()*2
-                                                +boxMessage.getFORTYHC()*2+boxMessage.getFORTYHR()*2+boxMessage.getFORTYOT()*2+boxMessage.getFORTYTK()*2);
-                                        boxMessageList.add(boxMessage);
+                                    boxAddressMessage.setNumberSize(fOpcTnsTaTus.size()+fUpdateEF.size()+fCnTrStatus.size());
+                                    List<BoxMessage> opcTnsTaTus = this.getOpcTnsTaTus(fOpcTnsTaTus, trno);//获取调箱状态的箱新
+                                    List<BoxMessage> updateEF = this.getUpdateEF(fUpdateEF, trno);//获取空重的箱信息
+                                    List<BoxMessage> cnTrStatus = this.getCnTrStatus(fCnTrStatus, trno);//获取好坏的箱信息
+                                    if (CollectionUtils.isNotEmpty(opcTnsTaTus)){
+                                        boxMessageList.addAll(opcTnsTaTus);
+                                    }
+                                    if (CollectionUtils.isNotEmpty(updateEF)){
+                                        boxMessageList.addAll(updateEF);
+                                    }if (CollectionUtils.isNotEmpty(cnTrStatus)){
+                                        boxMessageList.addAll(cnTrStatus);
                                     }
                                     boxAddressMessage.setBoxMessages(boxMessageList);
                                     boxAddressMessageList.add(boxAddressMessage);
@@ -788,7 +819,7 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                     }
                 }
                 boxDistributionStatistics.setBoxAddressMessages(boxAddressMessageList);
-                boxDistributionStatistics.setNumber(fOpcTnsTaTus.size()*boxAddressMessageList.size());
+                boxDistributionStatistics.setNumber(fOpcTnsTaTus.size()*boxAddressMessageList.size()+fUpdateEF.size()*boxAddressMessageList.size()+fCnTrStatus.size()*boxAddressMessageList.size());
                 list.add(boxDistributionStatistics);
             }
 
@@ -796,6 +827,11 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
         return list;
     }
 
+    @Override
+    public List<Map<String, Object>> homeBox() {
+        return tCntrnoMapper.homeBox();
+    }
+
     /**
      * set字段
      *
@@ -828,4 +864,83 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
         Map<Object, Boolean> seen = new ConcurrentHashMap<>();
         return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
     }
+
+    /**
+     * 获取调箱动态的箱信息
+     * @param fOpcTnsTaTus
+     * @param trno
+     * @return
+     */
+    public List<BoxMessage> getOpcTnsTaTus(List<SysDictData> fOpcTnsTaTus,TCntrno trno){
+        List<BoxMessage> boxMessageList = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(fOpcTnsTaTus)){
+            for (SysDictData opcTnsTaTus : fOpcTnsTaTus) {
+                TCntrno tro = new TCntrno();
+                BoxMessage boxMessage = new BoxMessage();
+                tro.setfUpdateaddress(trno.getfUpdateaddress());
+                tro.setfOpctnstatus(opcTnsTaTus.getDictValue());
+                BoxMessage message = tCntrnoMapper.boxDistributionStatistics(tro);
+                if (message != null){
+                    boxMessage = message;
+                }
+                boxMessage.setOpcTnStatus(opcTnsTaTus.getDictLabel());
+                boxMessage.setUNIT(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
+                        +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()+boxMessage.getFORTYGP()
+                        +boxMessage.getFORTYHC()+boxMessage.getFORTYHR()+boxMessage.getFORTYOT()+boxMessage.getFORTYTK());
+                boxMessage.setTEU(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
+                        +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()*2+boxMessage.getFORTYGP()*2
+                        +boxMessage.getFORTYHC()*2+boxMessage.getFORTYHR()*2+boxMessage.getFORTYOT()*2+boxMessage.getFORTYTK()*2);
+                boxMessageList.add(boxMessage);
+            }
+        }
+        return boxMessageList;
+    }
+    public List<BoxMessage> getUpdateEF(List<SysDictData> fUpdateEF,TCntrno trno){
+        List<BoxMessage> boxMessageList = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(fUpdateEF)){
+            for (SysDictData sysDictData : fUpdateEF) {
+                TCntrno tro = new TCntrno();
+                BoxMessage boxMessage = new BoxMessage();
+                tro.setfUpdateaddress(trno.getfUpdateaddress());
+                tro.setfUpdateef(sysDictData.getDictValue());
+                BoxMessage message = tCntrnoMapper.boxDistributionStatistics(tro);
+                if (message != null){
+                    boxMessage = message;
+                }
+                boxMessage.setOpcTnStatus(sysDictData.getDictLabel());
+                boxMessage.setUNIT(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
+                        +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()+boxMessage.getFORTYGP()
+                        +boxMessage.getFORTYHC()+boxMessage.getFORTYHR()+boxMessage.getFORTYOT()+boxMessage.getFORTYTK());
+                boxMessage.setTEU(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
+                        +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()*2+boxMessage.getFORTYGP()*2
+                        +boxMessage.getFORTYHC()*2+boxMessage.getFORTYHR()*2+boxMessage.getFORTYOT()*2+boxMessage.getFORTYTK()*2);
+                boxMessageList.add(boxMessage);
+            }
+        }
+        return boxMessageList;
+    }
+    public List<BoxMessage> getCnTrStatus(List<SysDictData> fCnTrStatus,TCntrno trno){
+        List<BoxMessage> boxMessageList = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(fCnTrStatus)){
+            for (SysDictData cnTrStatus : fCnTrStatus) {
+                TCntrno tro = new TCntrno();
+                BoxMessage boxMessage = new BoxMessage();
+                tro.setfUpdateaddress(trno.getfUpdateaddress());
+                tro.setfCntrstatus(cnTrStatus.getDictValue());
+                BoxMessage message = tCntrnoMapper.boxDistributionStatistics(tro);
+                if (message != null){
+                    boxMessage = message;
+                }
+                boxMessage.setOpcTnStatus(cnTrStatus.getDictLabel());
+                boxMessage.setUNIT(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
+                        +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()+boxMessage.getFORTYGP()
+                        +boxMessage.getFORTYHC()+boxMessage.getFORTYHR()+boxMessage.getFORTYOT()+boxMessage.getFORTYTK());
+                boxMessage.setTEU(boxMessage.getTWENTYFR() +boxMessage.getTWENTYGP() + boxMessage.getTWENTYOT()
+                        +boxMessage.getTWENTYRF()+boxMessage.getTWENTYTK() +boxMessage.getFORTYFR()*2+boxMessage.getFORTYGP()*2
+                        +boxMessage.getFORTYHC()*2+boxMessage.getFORTYHR()*2+boxMessage.getFORTYOT()*2+boxMessage.getFORTYTK()*2);
+                boxMessageList.add(boxMessage);
+            }
+        }
+        return boxMessageList;
+    }
 }

+ 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();
+    }
 }

+ 1 - 1
ruoyi-shipping/src/main/resources/mapper/shipping/TCntrMapper.xml

@@ -172,7 +172,7 @@
         FROM
 	    t_cntr
 	    where f_status = 'T'
-	    ORDER BY  CONVERT(f_name USING gbk) asc
+	    ORDER BY  CONVERT(f_no USING gbk) asc
     </select>
     <select id="selectRcntrFId" parameterType="TCntr" resultType="long">
         SELECT

+ 46 - 14
ruoyi-shipping/src/main/resources/mapper/shipping/TCntrnoMapper.xml

@@ -126,7 +126,8 @@
             <if test="tc.fSource != null  and tc.fSource != ''">and tc.f_source = #{tc.fSource}</if>
             <if test="tc.fRent != null  and tc.fRent != ''">and tc.f_rent = #{tc.fRent}</if>
             <if test="tc.fUpdatetime != null ">and tc.f_updatetime = #{tc.fUpdatetime}</if>
-            <if test="tc.fUpdateaddress != null  and tc.fUpdateaddress != ''">and tc.f_updateaddress = #{tc.fUpdateaddress}</if>
+            <if test='tc.fUpdateaddress != null  and tc.fUpdateaddress != "" and tc.fUpdateaddress != "0"'>and tc.f_updateaddress = #{tc.fUpdateaddress}</if>
+            <if test='tc.fUpdateaddress != null  and tc.fUpdateaddress != "" and tc.fUpdateaddress == "0"'>and tc.f_updateaddress = ''</if>
             <if test="tc.fUpdateef != null  and tc.fUpdateef != ''">and tc.f_updateEF = #{tc.fUpdateef}</if>
             <if test="tc.fCntrstatus != null  and tc.fCntrstatus != ''">and tc.f_cntrstatus = #{tc.fCntrstatus}</if>
             <if test="tc.fStatus != null  and tc.fStatus != ''">and tc.f_status = #{tc.fStatus}</if>
@@ -395,10 +396,8 @@
     <select id="getTCntrnoMessage" parameterType="string" resultType="map">
         SELECT
         container.*,
-        box.`空`,
-        box.`重`,
-        car.`好`,
-        car.`坏`
+        box.*,
+        car.*
         FROM
         (
         SELECT
@@ -434,14 +433,16 @@
         ) container
         LEFT JOIN (
         SELECT
-        a.f_updateaddress,
-        MAX( CASE WHEN a.dict_label = '空' THEN a.efCount ELSE 0 END ) AS 空,
-        MAX( CASE WHEN a.dict_label = '重' THEN a.efCount ELSE 0 END ) AS 重
+        a.f_updateaddress
+        <if test=" stand != null and stand != ''">
+            ,${stand}
+        </if>
         FROM
         (
         SELECT
         tc.f_updateaddress f_updateaddress,
         tc.f_updateEF f_updateEF,
+        tc.typeName typeName,
         tc.efCount efCount,
         sdda.dict_label dict_label
         FROM
@@ -449,15 +450,18 @@
         SELECT
         ta.f_name f_updateaddress,
         tct.f_updateEF,
+        tc.f_no typeName,
         COUNT( tct.f_updateaddress ) efCount
         FROM
         t_cntrno tct
         LEFT JOIN t_address ta ON tct.f_updateaddress = ta.f_id
+        LEFT JOIN t_cntr tc ON tct.f_typeid = tc.f_id
         WHERE
         tct.f_status = 'T'
         GROUP BY
         tct.f_updateaddress,
-        tct.f_updateEF
+        tct.f_updateEF,
+        tct.f_typeid
         ) tc
         LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
         AND sdda.dict_type = 'f_updateEF'
@@ -467,30 +471,35 @@
         ) box ON container.地点 = box.f_updateaddress
         LEFT JOIN (
         SELECT
-        b.f_updateaddress,
-        MAX( CASE WHEN b.dict_label = '好' THEN b.statusCount ELSE 0 END ) AS 好,
-        MAX( CASE WHEN b.dict_label = '坏' THEN b.statusCount ELSE 0 END ) AS 坏
+        b.f_updateaddress
+        <if test=" bareWeight != null and bareWeight != ''">
+            ,${bareWeight}
+        </if>
         FROM
         (
         SELECT
         tc.f_updateaddress f_updateaddress,
         tc.f_cntrstatus f_cntrstatus,
         tc.statusCount statusCount,
+        tc.typeName typeName,
         sdda.dict_label dict_label
         FROM
         (
         SELECT
         ta.f_name f_updateaddress,
         tct.f_cntrstatus,
+        tc.f_no typeName,
         COUNT( tct.f_updateaddress ) statusCount
         FROM
         t_cntrno tct
         LEFT JOIN t_address ta ON tct.f_updateaddress = ta.f_id
+        LEFT JOIN t_cntr tc ON tct.f_typeid = tc.f_id
         WHERE
         tct.f_status = 'T'
         GROUP BY
         tct.f_updateaddress,
-        tct.f_cntrstatus
+        tct.f_cntrstatus,
+        tct.f_typeid
         ) tc
         LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_cntrstatus
         AND sdda.dict_type = 'f_cntrstatus'
@@ -582,7 +591,7 @@
         MAX(case when tc.fNo = '20RF' then tc.boxNumber ELSE 0 end) AS 'TWENTYRF',
         MAX(case when tc.fNo = '20OT' then tc.boxNumber ELSE 0 end) AS 'TWENTYOT',
         MAX(case when tc.fNo = '20FR' then tc.boxNumber ELSE 0 end) AS 'TWENTYFR',
-        MAX(case when tc.fNo = '20TK' then tc.boxNumber ELSE 0 end) AS 'TWENTYTK',
+        MAX(case when tc.fNo = '20HC' then tc.boxNumber ELSE 0 end) AS 'TWENTYTK',
         MAX(case when tc.fNo = '40GP' then tc.boxNumber ELSE 0 end) AS 'FORTYGP',
         MAX(case when tc.fNo = '40HC' then tc.boxNumber ELSE 0 end) AS 'FORTYHC',
         MAX(case when tc.fNo = '40HR' then tc.boxNumber ELSE 0 end) AS 'FORTYHR',
@@ -606,6 +615,8 @@
             <if test="fUpdateaddress != null  and fUpdateaddress != ''">and tc.f_updateaddress = #{fUpdateaddress}</if>
             <if test="fOpctnstatus != null  and fOpctnstatus != ''">and tc.f_opctnstatus = #{fOpctnstatus}</if>
             <if test="remark != null">and tc.remark = #{remark}</if>
+            <if test="fUpdateef != null and fUpdateef != ''">and tc.f_updateEF = #{fUpdateef}</if>
+            <if test="fCntrstatus != null and fCntrstatus != ''">and tc.f_cntrstatus = #{fCntrstatus}</if>
         </where>
         GROUP BY
         LEFT ( tr.f_no, 2 ),
@@ -675,6 +686,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>

+ 210 - 134
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,45 @@ 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 +166,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 +254,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 +372,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 +397,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 +451,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 +485,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 +497,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 +571,70 @@ 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
+ORDER BY ta.fETA DESC
+LIMIT 10
+    </select>
 
 </mapper>

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

@@ -201,5 +201,46 @@ 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
+	ORDER BY CONVERT(tp.f_name USING gbk) asc
+	LIMIT 10
+    </select>
     
 </mapper>

+ 10 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/domain/TWhgenleg.java

@@ -231,10 +231,20 @@ public class TWhgenleg extends BaseEntity {
     private Long isCntrno;
     /** 是否按照提单号 */
     private Long isMblno;
+    //手机号
+    private String fTel;
 
     private String timeStartBsdate;
     private String timeEndBsdate;
 
+    public String getfTel() {
+        return fTel;
+    }
+
+    public void setfTel(String fTel) {
+        this.fTel = fTel;
+    }
+
     public static long getSerialVersionUID() {
         return serialVersionUID;
     }

+ 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();
 }

+ 24 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -851,6 +851,14 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         TWarehouseBills warehouseBills = JSONArray.parseObject(tWarehousebills, TWarehouseBills.class);
         JSONArray jsonCrArray = JSONArray.parseArray(tWarehousebillsCntr);
         List<TWarehousebillsCntr> tWarehousebillsCntrs = JSONObject.parseArray(jsonCrArray.toJSONString(), TWarehousebillsCntr.class);
+        if (warehouseBills.getfVslid() == null){
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("船名不能为空");
+        }
+        if (warehouseBills.getfVoyid() == null){
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("航次不能为空");
+        }
         //获取客户单位
         Long clientFid = tCorpsMapper.getClientFid(loginUser.getUser().getPhonenumber());
         if (warehouseBills.getfId() == null) {
@@ -2487,15 +2495,29 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         if (StringUtils.isNotEmpty(tWarehousebillsCntritems)) {
             JSONArray jsonCrArray = JSONArray.parseArray(tWarehousebillsCntritems);
             List<TWarehousebillsCntritems> tWarehousebillsCntritemsList = JSONObject.parseArray(jsonCrArray.toJSONString(), TWarehousebillsCntritems.class);
+            //获取货物信息
+            TWarehousebillsCntr warehousebillsCntr = tWarehousebillsCntrMapper.selectTWarehousebillsCntrByPId(warehouseBills.getfId());
+            if (warehousebillsCntr.getfCntrcount()< tWarehousebillsCntritemsList.size()){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return AjaxResult.error("箱信息中的箱量大于货物信息中的箱量");
+            }
             if (CollectionUtils.isNotEmpty(tWarehousebillsCntritemsList)) {
                 for (TWarehousebillsCntritems warehousebillsCntritems : tWarehousebillsCntritemsList) {
-                    TWarehousebillsCntr warehousebillsCntr = tWarehousebillsCntrMapper.selectTWarehousebillsCntrByPId(warehouseBills.getfId());
                     AjaxResult ajaxResult = this.judgeBoxPile(warehousebillsCntritems, warehousebillsCntr.getfCntrid());
                     String code = ajaxResult.get("code").toString();
                     if ("500".equals(code)) {
                         TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                         return ajaxResult;
                     }
+                    //先查箱号是否在对应的订单中存在存在不保存
+                    TWarehousebillsCntritems cntritems = new TWarehousebillsCntritems();
+                    cntritems.setfPid(warehouseBills.getfId());
+                    cntritems.setfCntrno(warehousebillsCntritems.getfCntrno());
+                    List<TWarehousebillsCntritems> list = tWarehousebillsCntritemsMapper.selectTWarehousebillsCntritemsList(cntritems);
+                    if (CollectionUtils.isNotEmpty(list)){
+                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                        return AjaxResult.error("箱号"+warehousebillsCntritems.getfCntrno()+"重复,请修改");
+                    }
                     warehousebillsCntritems.setfPid(warehouseBills.getfId());
                     warehousebillsCntritems.setCreateTime(DateUtils.getNowDate());
                     warehousebillsCntritems.setCreateBy(SecurityUtils.getUsername());
@@ -2558,11 +2580,11 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             }
             map.put("warehousebillsfeesDrList", warehousebillsfeesDrList);
         }
+        int i = tWarehousebillsCntrMapper.deleteTWarehousebillsCntrfPid(warehouseBills.getfId());
         if (StringUtils.isNotEmpty(tWarehousebillsCntr) && !"[]".equals(tWarehousebillsCntr)){
             JSONArray jsonCrArray = JSONArray.parseArray(tWarehousebillsCntr);
             List<TWarehousebillsCntr> tWarehousebillsCntrList = JSONObject.parseArray(jsonCrArray.toJSONString(), TWarehousebillsCntr.class);
             if (CollectionUtils.isNotEmpty(tWarehousebillsCntrList)) {
-                int i = tWarehousebillsCntrMapper.deleteTWarehousebillsCntrfPid(warehouseBills.getfId());
                 for (TWarehousebillsCntr warehousebillsCntr : tWarehousebillsCntrList) {
                     warehousebillsCntr.setfPid(warehouseBills.getfId());
                     warehousebillsCntr.setCreateTime(DateUtils.getNowDate());

+ 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();
+    }
 }

+ 4 - 0
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -570,6 +570,7 @@
 
     <select id="selectInventoryMapList" parameterType="TWhgenleg" resultType="Map">
         select
+        DISTINCT
             leg.f_id AS fId,
             leg.f_corpid AS fCorpIds,
             corp.f_name AS fCorpid,
@@ -607,8 +608,10 @@
         FROM
             t_whgenleg leg
             left join sys_user u on leg.create_by = u.user_name
+            left join sys_user u1 on leg.create_by = u1.user_name
             left join sys_dept d on u.dept_id = d.dept_id
             LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
+            LEFT JOIN t_customer_contact tc ON tc.f_pid = corp.f_id
             LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
             LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
             LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
@@ -621,6 +624,7 @@
             AND dict.dict_type = 'storage_type'
             AND dict1.dict_type = 'data_trademodes'
             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
+            <if test="fTel != null  and fTel != ''">and tc.f_tel = #{fTel}</if>
             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
             <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>

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

@@ -784,4 +784,28 @@
         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
+	LIMIT 10
+    </select>
 </mapper>