Browse Source

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

dongyongwei 4 years ago
parent
commit
4752230ebb
18 changed files with 449 additions and 42 deletions
  1. 18 6
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/KHTWarehousebillsController.java
  2. 16 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/KHUpdateOrderMessage.java
  3. 23 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TCntrno.java
  4. 22 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TVoyage.java
  5. 2 2
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/excel/TCntrnoExcel.java
  6. 96 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/excel/singleVoyageByShipExcel.java
  7. 7 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TCntrnoMapper.java
  8. 1 0
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TCntrnoServiceImpl.java
  9. 5 4
      ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TVoyageServiceImpl.java
  10. 4 3
      ruoyi-shipping/src/main/resources/mapper/shipping/TAddressMapper.xml
  11. 71 3
      ruoyi-shipping/src/main/resources/mapper/shipping/TCntrnoMapper.xml
  12. 20 5
      ruoyi-shipping/src/main/resources/mapper/shipping/TVoyageMapper.xml
  13. 6 0
      ruoyi-warehouse/pom.xml
  14. 12 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehouseBills.java
  15. 8 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehouseBillsMapper.java
  16. 15 1
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseBillsService.java
  17. 62 9
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java
  18. 61 8
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

+ 18 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/KHTWarehousebillsController.java

@@ -349,15 +349,16 @@ public class KHTWarehousebillsController extends BaseController
      * @throws Exception
      */
     @PostMapping(value = "/importCreate")
-    public AjaxResult importCreateCompanyMsgNew(@RequestParam("file") MultipartFile file)throws Exception
+    public AjaxResult importCreateCompanyMsgNew(@RequestParam("file") MultipartFile file,
+                                                @RequestParam("fId") Long fId)throws Exception
     {
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        try {
-            AjaxResult ajaxResult = tWarehousebillsService.importCreateCompanyMsgNew(file, loginUser);
+//        try {
+            AjaxResult ajaxResult = tWarehousebillsService.importCreateCompanyMsgNew(file, loginUser,fId);
             return ajaxResult;
-        }catch (Exception e){
-            return AjaxResult.error("导入失败");
-        }
+//        }catch (Exception e){
+//            return AjaxResult.error("导入失败");
+//        }
     }
     /**
      * 下载箱信息导入模板
@@ -413,4 +414,15 @@ public class KHTWarehousebillsController extends BaseController
         }
         return tWarehousebillsService.batchModifyingVesselVoyage(tWarehousebills.getOrderId(),tWarehousebills.getfVslid(),tWarehousebills.getfVoyid());
     }
+
+    /**
+     * 配船
+     * @param tWarehousebills 主表
+     * fCargoPlanning 是否配船(0 是 1 否) 默认为1
+     * @return
+     */
+    @PostMapping("/cargoPlanning")
+    public AjaxResult cargoPlanning(@RequestBody TWarehouseBills tWarehousebills){
+        return toAjax(tWarehousebillsService.updateKaHeOrder(tWarehousebills));
+    }
 }

+ 16 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/KHUpdateOrderMessage.java

@@ -7,8 +7,10 @@ package com.ruoyi.web.controller.shipping.controller;
  */
 
 import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -16,6 +18,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.framework.web.service.TokenService;
 import com.ruoyi.shipping.domain.TAddress;
+import com.ruoyi.shipping.excel.singleVoyageByShipExcel;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
 import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
 import lombok.extern.slf4j.Slf4j;
@@ -30,7 +33,7 @@ import java.util.List;
 @Slf4j
 @RestController
 @RequestMapping("/khwarehouse/updateOrderMessage")
-public class KHUpdateOrderMessage {
+public class KHUpdateOrderMessage extends BaseController {
     @Autowired
     private ITWarehouseBillsService tWarehousebillsService;
 
@@ -95,6 +98,18 @@ public class KHUpdateOrderMessage {
         return tWarehousebillsService.deleteOrder(tWarehouseBills,loginUser);
     }
 
+    /**
+     * 凯和单航次配船
+     * @param tWarehouseBills
+     * @return
+     */
+    @GetMapping("/singleVoyageByShip")
+    public TableDataInfo singleVoyageByShip (TWarehouseBills tWarehouseBills){
+        startPage();
+        List<singleVoyageByShipExcel> singleVoyageByShipExcels = tWarehousebillsService.singleVoyageByShip(tWarehouseBills);
+        return getDataTable(singleVoyageByShipExcels);
+    }
+
 }
 
 

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

@@ -111,6 +111,13 @@ public class TCntrno extends BaseEntity
     @Excel(name = "箱龄(月)")
     @JsonFormat(pattern = "MM")
     private String fBoxTurtleMonth;
+    /** 箱公司 */
+    @Excel(name = "箱主(手填)")
+    private String fBoxLord;
+
+    /** 合同协议号 */
+    @Excel(name = "合同协议号")
+    private String fPactDealHorn;
 
     /** 最新地点 */
     private String fUpdateaddress;
@@ -150,6 +157,22 @@ public class TCntrno extends BaseEntity
     //调箱动作中文名
     private String opctnstatusName;
 
+    public String getfBoxLord() {
+        return fBoxLord;
+    }
+
+    public void setfBoxLord(String fBoxLord) {
+        this.fBoxLord = fBoxLord;
+    }
+
+    public String getfPactDealHorn() {
+        return fPactDealHorn;
+    }
+
+    public void setfPactDealHorn(String fPactDealHorn) {
+        this.fPactDealHorn = fPactDealHorn;
+    }
+
     public Date getfBuildBoxTime() {
         return fBuildBoxTime;
     }

+ 22 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TVoyage.java

@@ -97,6 +97,9 @@ public class TVoyage extends BaseEntity
     /** 默认 T ,正常T 停用F 下拉选择 */
     @Excel(name = "默认 T ,正常T 停用F 下拉选择")
     private String fStatus;
+    /** 航线 */
+    @Excel(name = "航线")
+    private Integer fLaneid;
     //查询时间区间
     private List<String> cLoadDate;
     //装货港名称
@@ -121,6 +124,24 @@ public class TVoyage extends BaseEntity
     private List<TVoyage> freight;
     //中转港是否为空
     private Long empty;
+    //航线名称
+    private String fLaneName;
+
+    public String getfLaneName() {
+        return fLaneName;
+    }
+
+    public void setfLaneName(String fLaneName) {
+        this.fLaneName = fLaneName;
+    }
+
+    public Integer getfLaneid() {
+        return fLaneid;
+    }
+
+    public void setfLaneid(Integer fLaneid) {
+        this.fLaneid = fLaneid;
+    }
 
     public Long getEmpty() {
         return empty;
@@ -415,6 +436,7 @@ public class TVoyage extends BaseEntity
             .append("updateBy", getUpdateBy())
             .append("updateTime", getUpdateTime())
             .append("remark", getRemark())
+            .append("fLaneid", getfLaneid())
             .toString();
     }
 }

+ 2 - 2
ruoyi-shipping/src/main/java/com/ruoyi/shipping/excel/TCntrnoExcel.java

@@ -22,8 +22,8 @@ public class TCntrnoExcel {
     private String fUpdateef;
     //箱状态
     private String fCntrstatus;
-    //箱主中文
-    @Excel(name = "箱主",readConverterExp = "如凯和")
+    //租赁中文
+    @Excel(name = "租赁公司",readConverterExp = "如凯和")
     private String ownerName;
     //箱类型中文
     @Excel(name = "箱类型",readConverterExp = "如20GP")

+ 96 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/excel/singleVoyageByShipExcel.java

@@ -0,0 +1,96 @@
+package com.ruoyi.shipping.excel;
+
+import com.ruoyi.common.annotation.Excel;
+
+import java.util.Date;
+
+/**
+ * 凯和单航次配船
+ */
+public class singleVoyageByShipExcel {
+
+    private static final long serialVersionUID = 1L;
+    @Excel(name = "船名")
+    private String vslName;
+    @Excel(name = "航次")
+    private String voyNo;
+    @Excel(name = "开船日期")
+    private Date fAtd;
+    @Excel(name = "到港日期")
+    private Date fAta;
+    @Excel(name = "航线")
+    private String fName;
+    @Excel(name = "装港")
+    private String loadportName;
+    @Excel(name = "卸港")
+    private String destportName;
+
+    public String getVslName() {
+        return vslName;
+    }
+
+    public void setVslName(String vslName) {
+        this.vslName = vslName;
+    }
+
+    public String getVoyNo() {
+        return voyNo;
+    }
+
+    public void setVoyNo(String voyNo) {
+        this.voyNo = voyNo;
+    }
+
+    public Date getfAtd() {
+        return fAtd;
+    }
+
+    public void setfAtd(Date fAtd) {
+        this.fAtd = fAtd;
+    }
+
+    public Date getfAta() {
+        return fAta;
+    }
+
+    public void setfAta(Date fAta) {
+        this.fAta = fAta;
+    }
+
+    public String getfName() {
+        return fName;
+    }
+
+    public void setfName(String fName) {
+        this.fName = fName;
+    }
+
+    public String getLoadportName() {
+        return loadportName;
+    }
+
+    public void setLoadportName(String loadportName) {
+        this.loadportName = loadportName;
+    }
+
+    public String getDestportName() {
+        return destportName;
+    }
+
+    public void setDestportName(String destportName) {
+        this.destportName = destportName;
+    }
+
+    @Override
+    public String toString() {
+        return "singleVoyageByShipExcel{" +
+                "vslName='" + vslName + '\'' +
+                ", voyNo='" + voyNo + '\'' +
+                ", fAtd=" + fAtd +
+                ", fAta=" + fAta +
+                ", fName='" + fName + '\'' +
+                ", loadportName='" + loadportName + '\'' +
+                ", destportName='" + destportName + '\'' +
+                '}';
+    }
+}

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

@@ -21,6 +21,13 @@ public interface TCntrnoMapper
      * @return 集装箱号
      */
     public TCntrno selectTCntrnoById(Long fId);
+    /**
+     * 查询集装箱号
+     *
+     * @param fNo 集装箱号箱号
+     * @return 集装箱号
+     */
+    public TCntrno selectTCnTrNoByfNo(@Param("fNo") String fNo);
 
     /**
      * 查询集装箱号列表

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

@@ -155,6 +155,7 @@ public class TCntrnoServiceImpl implements ITCntrnoService {
                 tCntrtrackingMapper.insertTCntrtracking(setfield);
                 if (CollectionUtils.isNotEmpty(cntrno.getAccessoryList())) {
                     for (TConditionAccessory tConditionAccessory : cntrno.getAccessoryList()) {
+                        tConditionAccessory.setfOrgId(10L);
                         tConditionAccessory.setfPid(setfield.getfId());
                         tConditionAccessory.setCreateBy(SecurityUtils.getUsername());
                         tConditionAccessory.setCreateTime(DateUtils.getNowDate());

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

@@ -1,8 +1,7 @@
 package com.ruoyi.shipping.service.impl;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.ruoyi.common.constant.UserConstants;
@@ -57,7 +56,9 @@ public class TVoyageServiceImpl implements ITVoyageService
 
     @Override
     public List<TVoyage> freightList(TVoyage tVoyage) {
-        List<TVoyage> tVoyages = tVoyageMapper.selectTVoyageListNew(tVoyage);
+        List<TVoyage> tVoyages = new ArrayList<>();
+        tVoyages = tVoyageMapper.selectTVoyageListNew(tVoyage);
+        tVoyages = tVoyages.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TVoyage -> TVoyage.getfPortofloadid() + ";"+ TVoyage.getfDistinationid()+ ";"+ TVoyage.getfPortoftransshipment()))), ArrayList::new));
         if (CollectionUtils.isNotEmpty(tVoyages)){
             for (TVoyage voyage : tVoyages) {
                 voyage.setTwenty(tCtnpriceItemsMapper.selectMoney(voyage.getfPortofloadid(), voyage.getfDistinationid(), "20GP"));

+ 4 - 3
ruoyi-shipping/src/main/resources/mapper/shipping/TAddressMapper.xml

@@ -450,8 +450,8 @@
     <!--查看航线名称-->
     <select id="selectAirLineName" parameterType="TAddress" resultType="map">
         SELECT
-        f_id as fId,
-        f_name as fName
+        t.f_id as fId,
+        t.f_name as fName
         FROM
         t_address t
         LEFT JOIN
@@ -459,7 +459,8 @@
         ON t.f_types = s.dict_value
         WHERE t.f_status = 'T'
         AND s.dict_label = '航线'
-        <if test="fName != null  and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
+        <if test="fName != null  and fName != ''">and t.f_name like concat('%', #{fName}, '%')</if>
+        <if test="fId != null ">and t.f_id = #{fId}</if>
         ORDER BY CONVERT(t.f_name USING gbk) asc
     </select>
     <!--查看堆场名称-->

+ 71 - 3
ruoyi-shipping/src/main/resources/mapper/shipping/TCntrnoMapper.xml

@@ -26,11 +26,13 @@
         <result property="fBuildBoxTime"    column="f_build_box_time"    />
         <result property="fBoxTurtleYear"    column="f_box_turtle_year"    />
         <result property="fBoxTurtleMonth"    column="f_box_turtle_month"    />
+        <result property="fBoxLord"    column="f_box_lord"    />
+        <result property="fPactDealHorn"    column="f_pact_deal_horn"    />
     </resultMap>
 
     <sql id="selectTCntrnoVo">
         select f_id, f_no, f_typeid, f_owner, f_source, f_rent, f_updatetime, f_updateaddress, f_updateEF, f_cntrstatus, case when f_status = 'T' then '正常' else '停用' end as f_status,f_opctnstatus,f_sealno,create_by, create_time, update_by, update_time, remark,
-               f_build_box_time,f_box_turtle_year,f_box_turtle_month from t_cntrno
+               f_build_box_time,f_box_turtle_year,f_box_turtle_month,f_box_lord,f_pact_deal_horn from t_cntrno
     </sql>
 
     <select id="selectTCntrnoList" parameterType="TCntrno" resultMap="TCntrnoResult">
@@ -57,6 +59,8 @@
             <if test="fBuildBoxTime != null "> and f_build_box_time = #{fBuildBoxTime}</if>
             <if test="fBoxTurtleYear != null  and fBoxTurtleYear != ''"> and f_box_turtle_year = #{fBoxTurtleYear}</if>
             <if test="fBoxTurtleMonth != null  and fBoxTurtleMonth != ''"> and f_box_turtle_month = #{fBoxTurtleMonth}</if>
+            <if test="fBoxLord != null  and fBoxLord != ''"> and f_box_lord = #{fBoxLord}</if>
+            <if test="fPactDealHorn != null  and fPactDealHorn != ''"> and f_pact_deal_horn = #{fPactDealHorn}</if>
         </where>
     </select>
     <select id="selectTcntrnoMessage" parameterType="TCntrno" resultMap="TCntrnoResult">
@@ -89,7 +93,9 @@
         tc.remark,
         tc.f_build_box_time,
         tc.f_box_turtle_year,
-        tc.f_box_turtle_month
+        tc.f_box_turtle_month,
+        tc.f_box_lord,
+        tc.f_pact_deal_horn
         FROM
         t_cntrno tc
         LEFT JOIN sys_dict_data pro ON pro.dict_value = tc.f_owner
@@ -136,6 +142,8 @@
             <if test="tc.fBuildBoxTime != null "> and tc.f_build_box_time = #{fBuildBoxTime}</if>
             <if test="tc.fBoxTurtleYear != null  and tc.fBoxTurtleYear != ''"> and tc.f_box_turtle_year = #{fBoxTurtleYear}</if>
             <if test="tc.fBoxTurtleMonth != null  and tc.fBoxTurtleMonth != ''"> and tc.f_box_turtle_month = #{fBoxTurtleMonth}</if>
+            <if test="tc.fBoxLord != null  and tc.fBoxLord != ''"> and tc.f_box_lord = #{tc.fBoxLord}</if>
+            <if test="tc.fPactDealHorn != null  and tc.fPactDealHorn != ''"> and tc.f_pact_deal_horn = #{tc.fPactDealHorn}</if>
         </where>
         ORDER BY tc.f_no,CONVERT(tc.f_updateaddress USING gbk),CONVERT(t.f_no USING gbk),
         tc.f_updateEF,tc.f_cntrstatus,tc.f_owner
@@ -172,7 +180,9 @@
         tc.remark,
         tc.f_build_box_time,
         tc.f_box_turtle_year,
-        tc.f_box_turtle_month
+        tc.f_box_turtle_month,
+        tc.f_box_lord,
+        tc.f_pact_deal_horn
         FROM
         t_cntrno tc
         LEFT JOIN sys_dict_data pro ON pro.dict_value = tc.f_owner
@@ -191,6 +201,58 @@
         LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
         where tc.f_id = #{fId}
     </select>
+    <select id="selectTCnTrNoByfNo" parameterType="Long" resultMap="TCntrnoResult">
+        SELECT
+        tc.f_id,
+        tc.f_no,
+        tc.f_typeid,
+        tc.f_sealno,
+        t.f_name typeidName,
+		t.f_cntrsize cntrsize,
+		prs.dict_label cntrsizeName,
+        tc.f_owner,
+        pro.dict_label ownerName,
+        tc.f_source,
+        sd.dict_label sourceName,
+        tc.f_rent,
+        sdd.dict_label rentName,
+        tc.f_updatetime,
+        tc.f_updateaddress,
+        address.f_name addressName,
+        tc.f_updateEF,
+        sdda.dict_label updateEFName,
+        tc.f_cntrstatus,
+        pr.dict_label cntrstatusName,
+        case when tc.f_status = 'T' then '正常' else '停用' end as f_status,
+        tc.f_opctnstatus,
+        tc.create_by,
+        tc.create_time,
+        tc.update_by,
+        tc.update_time,
+        tc.remark,
+        tc.f_build_box_time,
+        tc.f_box_turtle_year,
+        tc.f_box_turtle_month,
+        tc.f_box_lord,
+        tc.f_pact_deal_horn
+        FROM
+        t_cntrno tc
+        LEFT JOIN sys_dict_data pro ON pro.dict_value = tc.f_owner
+        AND pro.dict_type = 'f_owner'
+        LEFT JOIN sys_dict_data sd ON sd.dict_value = tc.f_source
+        AND sd.dict_type = 'f_source'
+        LEFT JOIN sys_dict_data sdd ON sdd.dict_value = tc.f_rent
+        AND sdd.dict_type = 'f_rent'
+        LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
+        AND sdda.dict_type = 'f_updateEF'
+        LEFT JOIN sys_dict_data pr ON pr.dict_value = tc.f_cntrstatus
+        AND pr.dict_type = 'f_cntrstatus'
+        LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
+		LEFT JOIN sys_dict_data prs ON prs.dict_value = t.f_cntrsize
+        AND prs.dict_type = 'f_cntrsize'
+        LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
+        where tc.f_no = #{fNo}
+    </select>
 
     <insert id="insertTCntrno" parameterType="TCntrno">
         insert into t_cntrno
@@ -216,6 +278,8 @@
             <if test="fBuildBoxTime != null">f_build_box_time,</if>
             <if test="fBoxTurtleYear != null">f_box_turtle_year,</if>
             <if test="fBoxTurtleMonth != null">f_box_turtle_month,</if>
+            <if test="fBoxLord != null">f_box_lord,</if>
+            <if test="fPactDealHorn != null">f_pact_deal_horn,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fId != null">#{fId},</if>
@@ -239,6 +303,8 @@
             <if test="fBuildBoxTime != null">#{fBuildBoxTime},</if>
             <if test="fBoxTurtleYear != null">#{fBoxTurtleYear},</if>
             <if test="fBoxTurtleMonth != null">#{fBoxTurtleMonth},</if>
+            <if test="fBoxLord != null">#{fBoxLord},</if>
+            <if test="fPactDealHorn != null">#{fPactDealHorn},</if>
         </trim>
     </insert>
 
@@ -265,6 +331,8 @@
             <if test="fBuildBoxTime != null">f_build_box_time = #{fBuildBoxTime},</if>
             <if test="fBoxTurtleYear != null">f_box_turtle_year = #{fBoxTurtleYear},</if>
             <if test="fBoxTurtleMonth != null">f_box_turtle_month = #{fBoxTurtleMonth},</if>
+            <if test="fBoxLord != null">f_box_lord = #{fBoxLord},</if>
+            <if test="fPactDealHorn != null">f_pact_deal_horn = #{fPactDealHorn},</if>
         </trim>
         where f_id = #{fId}
     </update>

+ 20 - 5
ruoyi-shipping/src/main/resources/mapper/shipping/TVoyageMapper.xml

@@ -28,14 +28,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <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">
-        select f_id, f_pid, f_no, f_portofloadid, f_portofdischargeid, f_distinationid, f_portoftransshipment, f_ETD, f_ATD, f_ETA, f_ATA, f_days, f_ducomentrayoffdate, f_cutoffdate, f_teu, f_manageid, f_tel, case when f_status = 'T' then '正常' else '停用' end as f_status, create_by, create_time, update_by, update_time, remark from t_voyage
+        select f_id, f_pid, f_no, f_portofloadid, f_portofdischargeid, f_distinationid, f_portoftransshipment, f_ETD, f_ATD, f_ETA, f_ATA, f_days, f_ducomentrayoffdate, f_cutoffdate, f_teu, f_manageid, f_tel, case when f_status = 'T' then '正常' else '停用' end as f_status, create_by, create_time, update_by, update_time, remark,f_laneid from t_voyage
     </sql>
 
     <select id="selectTVoyageList" parameterType="TVoyage" resultMap="TVoyageResult">
         SELECT
+        DISTINCT
         tv.f_id,
         tv.f_pid,
         te.f_name pidName,
@@ -69,7 +71,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         tv.create_time,
         tv.update_by,
         tv.update_time,
-        tv.remark
+        tv.remark,
+        tv.f_laneid,
+        tes.f_name as fLaneName
         FROM
         t_voyage tv
         LEFT JOIN t_vessel te ON tv.f_pid = te.f_id
@@ -78,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         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 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>
@@ -111,6 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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>
         </where>
     </select>
     <select id="selectMessage" parameterType="TVoyage" resultMap="TVoyageResult">
@@ -148,7 +154,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         tv.create_time,
         tv.update_by,
         tv.update_time,
-        tv.remark
+        tv.remark,
+        tv.f_laneid
         FROM
         t_voyage tv
         LEFT JOIN t_vessel te ON tv.f_pid = te.f_id
@@ -161,6 +168,7 @@ 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="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>
@@ -192,6 +200,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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>
         </where>
     </select>
     <select id="selectTVoyageListNew" parameterType="TVoyage" resultMap="TVoyageResult">
@@ -229,7 +238,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         tv.create_time,
         tv.update_by,
         tv.update_time,
-        tv.remark
+        tv.remark,
+        tv.f_laneid
         FROM
         t_voyage tv
         LEFT JOIN t_vessel te ON tv.f_pid = te.f_id
@@ -273,6 +283,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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>
         </where>
     </select>
 
@@ -314,7 +325,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             tv.create_time,
             tv.update_by,
             tv.update_time,
-            tv.remark
+            tv.remark,
+            tv.f_laneid
         FROM
             t_voyage tv
                 LEFT JOIN t_vessel te ON tv.f_pid = te.f_id
@@ -352,6 +364,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
+            <if test="fLaneid != null">f_laneid,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fPid != null">#{fPid},</if>
@@ -376,6 +389,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
+            <if test="fLaneid != null">#{fLaneid},</if>
          </trim>
     </insert>
 
@@ -406,6 +420,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remark != null">remark = #{remark},</if>
+            <if test="fLaneid != null">f_laneid = #{fLaneid},</if>
         </trim>
         where f_id = #{fId}
     </update>

+ 6 - 0
ruoyi-warehouse/pom.xml

@@ -47,6 +47,12 @@
             <groupId>com.ruoyi</groupId>
             <artifactId>ruoyi-shipping</artifactId>
         </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.5</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
 </project>

+ 12 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehouseBills.java

@@ -558,6 +558,9 @@ public class TWarehouseBills extends BaseEntity {
     /** 收费提示字段 */
     @Excel(name = "收费提示字段")
     private String fRemarksFees;
+    /** 是否配船(0 是 1 否) */
+    @Excel(name = "是否配船(0 是 1 否)")
+    private Integer fCargoPlanning;
 
     /** 仓储费计费类型 */
     @Excel(name = "仓储费计费类型")
@@ -671,6 +674,14 @@ public class TWarehouseBills extends BaseEntity {
     //凯和订单ID
     private Long[] orderId;
 
+    public Integer getfCargoPlanning() {
+        return fCargoPlanning;
+    }
+
+    public void setfCargoPlanning(Integer fCargoPlanning) {
+        this.fCargoPlanning = fCargoPlanning;
+    }
+
     public String getfRemarksFees() {
         return fRemarksFees;
     }
@@ -1881,6 +1892,7 @@ public class TWarehouseBills extends BaseEntity {
                 ", fSubmitUpdate=" + fSubmitUpdate +
                 ", fDeleteStatus=" + fDeleteStatus +
                 ", fRemarksFees=" + fRemarksFees +
+                ", fCargoPlanning=" + fCargoPlanning +
                 '}';
     }
 }

+ 8 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehouseBillsMapper.java

@@ -9,6 +9,7 @@ import com.ruoyi.reportManagement.domain.SingleAnalysisFeesExcel;
 import com.ruoyi.reportManagement.domain.TWareHouseItemsExcel;
 import com.ruoyi.reportManagement.dto.TWarehousebill;
 import com.ruoyi.shipping.excel.deriveInventoryExcel;
+import com.ruoyi.shipping.excel.singleVoyageByShipExcel;
 import com.ruoyi.warehouseBusiness.domain.TWareHouseExcelItems;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
 import org.apache.ibatis.annotations.Param;
@@ -220,4 +221,11 @@ public interface TWarehouseBillsMapper extends BaseMapper<TWarehouseBills> {
     public int updateTWarehousebillsByIds(@Param("fIds") Long[] fIds,
                                           @Param("fVessel") Long fVessel,
                                           @Param("fVoyage") Long fVoyage);
+
+    /**
+     * 凯和单航次配船
+     * @param tWarehouseBills 主表
+     * @return
+     */
+    public List<singleVoyageByShipExcel> singleVoyageByShip(TWarehouseBills tWarehouseBills);
 }

+ 15 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseBillsService.java

@@ -4,6 +4,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.reportManagement.domain.TWareHouseItemsExcel;
 import com.ruoyi.reportManagement.dto.TWarehousebill;
+import com.ruoyi.shipping.excel.singleVoyageByShipExcel;
 import com.ruoyi.system.domain.SysCheckCode;
 import com.ruoyi.warehouseBusiness.domain.StorageChargeInsert;
 import com.ruoyi.warehouseBusiness.domain.TWareHouseExcelItems;
@@ -431,7 +432,7 @@ public interface ITWarehouseBillsService {
      * @param file  excel
      * @return  结果
      */
-    public AjaxResult importCreateCompanyMsgNew(MultipartFile file,LoginUser loginUser) throws Exception;
+    public AjaxResult importCreateCompanyMsgNew(MultipartFile file,LoginUser loginUser,Long fId) throws Exception;
 
     /**
      * 提交仓库主表审批
@@ -537,4 +538,17 @@ public interface ITWarehouseBillsService {
      * @return
      */
     public AjaxResult batchModifyingVesselVoyage(Long[] fIds,Long fVessel,Long fVoyage);
+    /**
+     * 凯和修改订单信息
+     *
+     * @param tWarehousebills 详情主表
+     * @return 结果
+     */
+    public int updateKaHeOrder(TWarehouseBills tWarehousebills);
+    /**
+     * 凯和单航次配船
+     * @param tWarehouseBills 主表
+     * @return
+     */
+    public List<singleVoyageByShipExcel> singleVoyageByShip(TWarehouseBills tWarehouseBills);
 }

+ 62 - 9
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -31,6 +31,7 @@ import com.ruoyi.reportManagement.mapper.TWhgenlegMapper;
 import com.ruoyi.shipping.domain.*;
 import com.ruoyi.shipping.excel.TWarehousebillsCntritemsExcel;
 import com.ruoyi.shipping.excel.deriveInventoryExcel;
+import com.ruoyi.shipping.excel.singleVoyageByShipExcel;
 import com.ruoyi.shipping.mapper.*;
 import com.ruoyi.system.domain.SysCheckCode;
 import com.ruoyi.system.domain.SysConfig;
@@ -170,6 +171,8 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     private TWarehousebillsfeesLoggerMapper tWarehousebillsfeesLoggerMapper;
     @Autowired
     private TVesselMapper tVesselMapper;
+    @Autowired
+    private TCntrnoMapper tCntrnoMapper;
     private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
 
 
@@ -1836,14 +1839,23 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
 
     @Override
     @Transactional
-    public AjaxResult importCreateCompanyMsgNew(MultipartFile file,LoginUser loginUser) throws Exception {
+    public AjaxResult importCreateCompanyMsgNew(MultipartFile file,LoginUser loginUser,Long fId) throws Exception {
+        //查询货物信息
+        TWarehousebillsCntr tWarehousebillsCntr = tWarehousebillsCntrMapper.selectTWarehousebillsCntrById(fId);
+        if (tWarehousebillsCntr == null){
+            return AjaxResult.success("error","未找到货物信息");
+        }
+        //查询集装箱信息
+        TCntr tCntr = tCntrMapper.selectTCntrById(tWarehousebillsCntr.getfCntrid());
         List<TTemporaryFile> fleetCompanyMsgs = new ArrayList<>();
-
+        List<String> tCnTrNoList = new ArrayList<>();
+        List<String> List = new ArrayList<>();
         InputStream inputStream = null;
         Map<String,Object> map = new HashMap<>();
+        String originalFilename;//文件名
         try {
             inputStream = file.getInputStream();
-            String originalFilename = file.getOriginalFilename();
+            originalFilename = file.getOriginalFilename();
             Workbook workbook = null;
             if (originalFilename.endsWith("xls")){
                 workbook = WorkbookFactory.create(inputStream);
@@ -1879,6 +1891,13 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                                 break;
                             }
                             companyMsg.setfCntrno(cell.getStringCellValue());
+                            //判断箱号是否存在
+                            TCntrno tCntrno = new TCntrno();
+                            tCntrno.setfNo(cell.getStringCellValue());
+                            List<TCntrno> cnTrNoList= tCntrnoMapper.selectTCntrnoList(tCntrno);
+                            if (CollectionUtils.isEmpty(cnTrNoList)){
+                                tCnTrNoList.add(cell.getStringCellValue());
+                            }
                             break;
                         case "铅封号":
                             //设置单元格类型
@@ -1936,7 +1955,12 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                                 return AjaxResult.success("Excel箱信息数据第" + line + "行数据缺少箱型",500);*/
                                 break;
                             }
-                            companyMsg.setCntrName(cell.getStringCellValue());
+                            if (tCntr.getfNo().equals(cell.getStringCellValue())){
+                                companyMsg.setCntrName(cell.getStringCellValue());
+                            }else {
+                                List.add(companyMsg.getfCntrno());
+                                break;
+                            }
                             /*Long fId = tCntrMapper.selectRcntrFId(companyMsg.getCntrName());
                             if (fId != null) {
                                 companyMsg.setfCntrid(fId);
@@ -1949,13 +1973,32 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 }
                 fleetCompanyMsgs.add(companyMsg);
             }
-            map.put("total",fleetCompanyMsgs.size());
-            map.put("fileName",originalFilename);
         } catch (IOException e) {
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return AjaxResult.error("上传文件失败,请检查文件是否损坏");
         }
-        return AjaxResult.success("success", map);
+        if (CollectionUtils.isNotEmpty(tCnTrNoList) || CollectionUtils.isNotEmpty(List)){
+            tTemporaryFileMapper.deleteTTemporaryFilefileName(originalFilename,loginUser.getUser().getUserName());
+            if (CollectionUtils.isNotEmpty(tCnTrNoList)){
+                StringBuffer stringBuffer = new StringBuffer("箱号不存在的有:"+"\n");
+                stringBuffer.append(org.apache.commons.lang.StringUtils.join(tCnTrNoList.toArray(), ","));
+                map.put("tCnTrNoList",stringBuffer.toString());
+            }
+            if (CollectionUtils.isNotEmpty(tCnTrNoList) && CollectionUtils.isNotEmpty(List)){
+                StringBuffer stringBuffer = new StringBuffer("箱型应为:"+tCntr.getfNo()+",不一致的有"+"\n");
+                stringBuffer.append(org.apache.commons.lang.StringUtils.join(List.toArray(), ","));
+                map.put("List",stringBuffer.toString());
+            }else if (CollectionUtils.isEmpty(tCnTrNoList) && CollectionUtils.isNotEmpty(List)){
+                StringBuffer stringBuffer = new StringBuffer("箱型应为:"+tCntr.getfNo()+",不一致的有"+"\n");
+                stringBuffer.append(org.apache.commons.lang.StringUtils.join(List.toArray(), ","));
+                map.put("List",stringBuffer.toString());
+            }
+            return AjaxResult.success("error",map);
+        }else {
+            map.put("total",fleetCompanyMsgs.size());
+            map.put("fileName",originalFilename);
+            return AjaxResult.success("success", map);
+        }
     }
 
     /**
@@ -5054,7 +5097,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         sheet.setColumnWidth(4,256*15);
         sheet.setColumnWidth(5,256*15);
         sheet.setColumnWidth(6,256*15);
-        sheet.setColumnWidth(7,256*15);
+        sheet.setColumnWidth(7,256*35);
         sheet.setColumnWidth(8,256*15);
         sheet.setColumnWidth(9,256*15);
         sheet.setColumnWidth(10,256*15);
@@ -5138,7 +5181,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     cellValue = list.get(i).getfCntrweight().toString();
                 }else if(j ==7){
                     //箱公司
-                    cellValue = list.get(i).getfSealno();
+                        cellValue = list.get(i).getBoxCompany();
                 }else if(j == 8){
                     //始发港
                     cellValue = list.get(i).getPortOfDeparture();
@@ -5225,6 +5268,16 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         }
     }
 
+    @Override
+    public int updateKaHeOrder(TWarehouseBills tWarehousebills) {
+        return tWarehouseBillsMapper.updateKaHeOrder(tWarehousebills);
+    }
+
+    @Override
+    public List<singleVoyageByShipExcel> singleVoyageByShip(TWarehouseBills tWarehouseBills) {
+        return tWarehouseBillsMapper.singleVoyageByShip(tWarehouseBills);
+    }
+
     private String getAbsoluteFile(String fileName) {
         String downloadPath = RuoYiConfig.getDownloadPath() + fileName;
         File desc = new File(downloadPath);

+ 61 - 8
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -115,6 +115,7 @@
         <result property="fSubmitUpdate"    column="f_submit_update"/>
         <result property="fDeleteStatus"    column="f_delete_status"/>
         <result property="fRemarksFees"    column="f_remarks_fees"    />
+        <result property="fCargoPlanning"    column="f_cargo_planning"    />
     </resultMap>
 
     <sql id="selectTWarehousebillsVo">
@@ -127,7 +128,7 @@
         f_consigneeattn, f_consigneetel, f_insurance, f_insuranceamt, f_closedate, f_docmentdate, f_vslid, f_voyid, f_typeid, f_paymode, f_laneid, f_cntval,
         free_container_date, f_business_attribution, f_supervision_unit, f_declaration_elements, f_part_number, f_ifinspection, f_value, f_weighing_date,
         f_ifsampling, send_sample_date, f_ifweight_recovery, weight_recovery_date, warehouse_status, f_times ,f_date_changed, f_chargetype,f_weigh_weight,
-               f_predict_branch,f_grade,f_delivery_details,f_salesman_id,f_itemstatus,f_updete_status, f_submit_update, f_delete_status,f_remarks_fees from t_warehousebills
+               f_predict_branch,f_grade,f_delivery_details,f_salesman_id,f_itemstatus,f_updete_status, f_submit_update, f_delete_status,f_remarks_fees,f_cargo_planning from t_warehousebills
     </sql>
 
     <select id="selectTWarehousebillsList" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
@@ -385,7 +386,7 @@
             <if test="fNewTrademodeid != null ">and bill.f_new_trademodeid = #{fNewTrademodeid}</if>
         </where>
         ${params.dataScope}
-        ORDER BY bill.f_billstatus , bill.f_bsdate DESC
+        ORDER BY bill.f_bsdate DESC, bill.f_bstime DESC,bill.f_id DESC,bill.f_billstatus
     </select>
 
     <select id="selectWarehouseBusinessList1" parameterType="TWarehousebills" resultType="Map">
@@ -537,7 +538,7 @@
             <if test="fNewTrademodeid != null ">and bill.f_new_trademodeid = #{fNewTrademodeid}</if>
         </where>
         ${params.dataScope}
-        ORDER BY bill.f_billstatus , bill.f_bsdate DESC
+        ORDER BY bill.f_bsdate DESC, bill.f_bstime DESC,bill.f_id DESC,bill.f_billstatus
     </select>
 
     <select id="selectTWarehousebillsById" parameterType="Long" resultMap="TWarehousebillsResult">
@@ -891,6 +892,7 @@
             <if test="fSubmitUpdate != null">f_submit_update,</if>
             <if test="fDeleteStatus != null">f_delete_status,</if>
             <if test="fRemarksFees != null">f_remarks_fees,</if>
+            <if test="fCargoPlanning != null">f_cargo_planning,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fBillno != null">#{fBillno},</if>
@@ -1002,6 +1004,7 @@
             <if test="fSubmitUpdate != null">#{fSubmitUpdate},</if>
             <if test="fDeleteStatus != null">#{fDeleteStatus},</if>
             <if test="fRemarksFees != null">#{fRemarksFees},</if>
+            <if test="fCargoPlanning != null">#{fCargoPlanning},</if>
         </trim>
     </insert>
 
@@ -1117,6 +1120,7 @@
             <if test="fSubmitUpdate != null">f_submit_update = #{fSubmitUpdate},</if>
             <if test="fDeleteStatus != null">f_delete_status = #{fDeleteStatus},</if>
             <if test="fRemarksFees != null">f_remarks_fees = #{fRemarksFees},</if>
+            <if test="fCargoPlanning != null">f_cargo_planning = #{fCargoPlanning},</if>
         </trim>
         where f_id = #{fId}
     </update>
@@ -1234,6 +1238,7 @@
             <if test="fSubmitUpdate != null">f_submit_update = #{fSubmitUpdate},</if>
             <if test="fDeleteStatus != null">f_delete_status = #{fDeleteStatus},</if>
             <if test="fRemarksFees != null">f_remarks_fees = #{fRemarksFees},</if>
+            <if test="fCargoPlanning != null">f_cargo_planning = #{fCargoPlanning},</if>
         </trim>
         where f_id = #{fId}
     </update>
@@ -1502,7 +1507,8 @@
             tr.f_name laneidName,
             tw.f_updete_status,
             tw.f_submit_update,
-            tw.f_delete_status
+            tw.f_delete_status,
+            tw.f_cargo_planning
         FROM t_warehousebills tw
             LEFT JOIN t_address address ON address.f_id = tw.f_loadportid
             LEFT JOIN t_address ta ON ta.f_id = tw.f_loadportid
@@ -1709,7 +1715,8 @@
         END AS moneyStatus,
         tw.f_updete_status fUpdeteStatus,
         tw.f_submit_update fSubmitUpdate,
-        tw.f_delete_status fDeleteStatus
+        tw.f_delete_status fDeleteStatus,
+        tw.f_cargo_planning fCargoPlanning
         FROM
         t_warehousebills tw
         LEFT JOIN t_address ta ON ta.f_id = tw.f_laneid
@@ -1958,7 +1965,8 @@
         tw.f_updete_status fUpdeteStatus,
         tw.f_submit_update fSubmitUpdate,
         tw.f_delete_status fDeleteStatus,
-        ROUND(IFNULL(tf.fAmount,0),2) fAmount
+        ROUND(IFNULL(tf.fAmount,0),2) fAmount,
+        tw.f_cargo_planning fCargoPlanning
         FROM
         t_warehousebills tw
         LEFT JOIN t_address ta ON ta.f_id = tw.f_laneid
@@ -2215,7 +2223,8 @@
                tr.f_name      laneidName,
                tw.f_updete_status,
                tw.f_submit_update,
-               tw.f_delete_status
+               tw.f_delete_status,
+               tw.f_cargo_planning
         FROM t_warehousebills tw
                  LEFT JOIN t_address address ON address.f_id = tw.f_loadportid
                  LEFT JOIN t_address ta ON ta.f_id = tw.f_loadportid
@@ -2476,7 +2485,11 @@
                     substring(tr.f_no,1,2) AS measure, /*尺寸*/
                     substring(tr.f_no,3,2) AS genre, /*类型*/
                     twc.f_cntrweight AS fCntrweight, /*重量*/
-                    pro.dict_label AS boxCompany, /*箱公司*/
+                    CASE
+                        WHEN tcr.f_soc = '0' THEN tc.f_name
+                        WHEN tcr.f_soc = '1' THEN '凯和志诚'
+                    END AS boxCompany,/*箱公司最新*/
+                    pro.dict_label AS boxCompanyOld, /*箱公司旧*/
                     td.f_name AS portOfDeparture, /*始发港*/
                     ts.f_name AS destinationPort, /*目的港*/
                     tg.f_name AS goodName, /*货名*/
@@ -2539,5 +2552,45 @@
             #{fId}
         </foreach>
     </update>
+    <!--凯和单航次配船-->
+    <select id="singleVoyageByShip" parameterType="TWarehousebills" resultType="com.ruoyi.shipping.excel.singleVoyageByShipExcel">
+       SELECT
+        tv.f_name vslName,
+        ty.f_no voyNo,
+				ty.f_ATD fAtd,
+				ty.f_ATA fAta,
+				ta.f_name fName,
+        tre.f_name loadportName,
+        ts.f_name  destportName
+
+        FROM
+        t_warehousebills tw
+        LEFT JOIN t_address ta ON ta.f_id = tw.f_laneid
+        LEFT JOIN t_address tre ON tre.f_id = tw.f_loadportid
+        LEFT JOIN t_address ts ON ts.f_id = tw.f_destportid
+        LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_serviceitems
+        AND sd.dict_type = 'f_serviceitems'
+        LEFT JOIN t_vessel tv ON tw.f_vslid = tv.f_id
+        LEFT JOIN t_voyage ty ON tw.f_voyid = ty.f_id
+        LEFT JOIN t_corps tp ON tw.f_corpid = tp.f_id
+        LEFT JOIN (
+        SELECT
+        th.f_pid,
+        th.f_cntrcount,
+        tr.f_no,
+        th.f_cntrid,
+        tg.f_name
+        FROM
+        t_warehousebills_cntr th
+        LEFT JOIN t_cntr tr ON th.f_cntrid = tr.f_id
+        LEFT JOIN t_goods tg ON th.f_goodsid = tg.f_id
+        ) tc ON tc.f_pid = tw.f_id
+        LEFT JOIN (SELECT f_pid,f_billstatus FROM t_warehousebillsfees GROUP BY f_pid,f_billstatus)tf ON tf.f_pid = tw.f_id
+        where
+            tw.f_typeid = '1'
+            and tw.del_flag = '0'
+        <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
+        <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
+    </select>
 
 </mapper>