Quellcode durchsuchen

修改单航次配船

lazhaoqian vor 3 Jahren
Ursprung
Commit
9752c04f96

+ 3 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/KHUpdateOrderMessage.java

@@ -6,6 +6,7 @@ package com.ruoyi.web.controller.shipping.controller;
  * @Version 1.0
  */
 
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -119,8 +120,8 @@ public class KHUpdateOrderMessage extends BaseController {
         if (tCntrno.getUpdateStatus() == null){
             return AjaxResult.error("请选择离港出运或到港卸船");
         }
-        if (tCntrno.getfVslid() == null ||tCntrno.getfVoyid() == null){
-            return AjaxResult.error("请选择船名航次");
+        if (CollectionUtils.isEmpty(tCntrno.getBillList())){
+            return AjaxResult.error("请选择要操作的提单号");
         }
         if (tCntrno.getfUpdatetime() == null){
             return AjaxResult.error("请选择离港出运或到港卸船时间");

+ 13 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TCntrnoMessage.java

@@ -160,10 +160,22 @@ public class TCntrnoMessage extends BaseEntity {
     //港口名称
     private String port;
     /**
+     * 离港出运或到港卸货的提单号
+     */
+    private List<String> billList;
+    /**
      * 是否按日志分组
      */
     private Integer whether = 0;
 
+    public List<String> getBillList() {
+        return billList;
+    }
+
+    public void setBillList(List<String> billList) {
+        this.billList = billList;
+    }
+
     public Integer getWhether() {
         return whether;
     }
@@ -561,6 +573,7 @@ public class TCntrnoMessage extends BaseEntity {
                 .append("fBoxTurtleMonth", getfBoxTurtleMonth())
                 .append("fMblno", getfMblno())
                 .append("fBoxWeight", getfBoxWeight())
+                .append("billList", getBillList())
                 .toString();
     }
 }

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

@@ -644,6 +644,10 @@ public class TWarehouseBills extends BaseEntity {
     private String paymodeName;
     //航线中文名
     private String laneidName;
+    /**
+     * 离港出运或到港卸货的提单号
+     */
+    private List<String> billList;
 
     public Integer getfArrivalStatus() {
         return fArrivalStatus;
@@ -653,6 +657,14 @@ public class TWarehouseBills extends BaseEntity {
         this.fArrivalStatus = fArrivalStatus;
     }
 
+    public List<String> getBillList() {
+        return billList;
+    }
+
+    public void setBillList(List<String> billList) {
+        this.billList = billList;
+    }
+
     public Long getfUpdeteStatus() {
         return fUpdeteStatus;
     }
@@ -1988,6 +2000,7 @@ public class TWarehouseBills extends BaseEntity {
                 ", fCargoPlanning=" + fCargoPlanning +
                 ", fArrivalStatus=" + fArrivalStatus +
                 ", fDismountStatus=" + fDismountStatus +
+                ", billList=" + billList +
                 '}';
     }
 }

+ 12 - 3
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -6490,8 +6490,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         Date date = tCntrno.getfUpdatetime();
         //查询船名航次对应的信息
         TWarehouseBills tWarehouseBills = new TWarehouseBills();
-        tWarehouseBills.setfVslid(tCntrno.getfVslid());
-        tWarehouseBills.setfVoyid(tCntrno.getfVoyid());
+       /* tWarehouseBills.setfVslid(tCntrno.getfVslid());
+        tWarehouseBills.setfVoyid(tCntrno.getfVoyid());*/
+        tWarehouseBills.setBillList(tCntrno.getBillList());
         tWarehouseBills.setfCargoPlanning(0L);
         if (tCntrno.getUpdateStatus().longValue() == 1) {
             tWarehouseBills.setfArrivalStatus(0);
@@ -6569,6 +6570,13 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("系统缺少箱动态卸船请维护");
             }
+            String address = null;
+            if (StringUtils.isNotEmpty(tCntrno.getfUpdateaddress())){
+                address = tCntrno.getfUpdateaddress();
+            }else {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return AjaxResult.error("请选择要卸船的港口");
+            }
             for (TWarehouseBills bills : tWarehouseBillsList) {
                 //查询货物信息
                 TWarehousebillsCntr warehousebillsCntr = tWarehousebillsCntrMapper.selectTWarehousebillsCntrByPId(bills.getfId());
@@ -6584,7 +6592,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                         cntrno.setUpdateBy(loginUser.getUser().getUserName());
                         cntrno.setfUpdatetime(date);
                         cntrno.setRemark(null);
-                        cntrno.setfUpdateaddress(bills.getfDestportid().toString());
+                        cntrno.setfUpdateaddress(address);
                         cntrno.setfOpctnstatus(fOpCTnsTaTus);
                         cntrno.setfCntrstatus(warehousebillsCntr.getfCntrstatus());
                         tCntrnoMapper.updateTCntrnoByfNo(cntrno);
@@ -6610,6 +6618,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 tWarehouseBillsMapper.updateKaHeOrder(warehouseBills);
             }
         } else {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return AjaxResult.error("请选择离岗出运或到港卸船");
         }
         return AjaxResult.success();

+ 17 - 2
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -1751,6 +1751,11 @@
             </if>
             <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
             <if test="fArrivalStatus != null "> and tw.f_arrival_status = #{fArrivalStatus}</if>
+            <if test="billList != null "> and tw.f_mblno in
+            <foreach item="fMblno" collection="billList" open="(" separator="," close=")">
+                #{fMblno}
+            </foreach>
+            </if>
         </where>
         ORDER BY tw.create_time DESC, tw.f_id DESC
     </select>
@@ -1858,7 +1863,8 @@
         tw.f_arrival_status fArrivalStatus,
         tw.f_vslid fVslid,
         tw.f_voyid fVoyid,
-        tw.remark remark
+        tw.remark remark,
+        IFNULL(tcntr.loadCntr,0) AS loadCntr
         FROM
         t_warehousebills tw
         LEFT JOIN t_address ta ON ta.f_id = tw.f_laneid
@@ -1884,6 +1890,14 @@
         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)tf ON tf.f_pid = tw.f_id
+        LEFT JOIN (
+        SELECT
+        th.f_pid,
+        count(th.f_pid) loadCntr
+        FROM
+        t_warehousebills_cntr th
+        GROUP BY th.f_pid
+        ) tcntr ON tcntr.f_pid = tw.f_id
         <where>
             tw.f_typeid = '1'
             and tw.del_flag = '0'
@@ -2024,7 +2038,8 @@
                 and ty.f_ATD &lt;= #{timeInterval[1]}
             </if>
             <if test="fCargoPlanning != null "> and tw.f_cargo_planning = #{fCargoPlanning}</if>
-            <if test="fArrivalStatus != null "> and tw.f_arrival_status = #{fArrivalStatus}</if>
+            <if test="fArrivalStatus != null and fArrivalStatus != 3"> and tw.f_arrival_status = #{fArrivalStatus}</if>
+            <if test="fArrivalStatus != null and fArrivalStatus == 3"> and tw.f_arrival_status != '2'</if>
         </where>
         ORDER BY tw.create_time DESC, tw.f_id DESC
     </select>