lazhaoqian il y a 4 ans
Parent
commit
252ec58c8f

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

@@ -225,11 +225,11 @@ public class KHTWarehousebillsController extends BaseController
         return getDataTable(warehouseBills);
     }
     @Log(title = "凯和网页版订单查询", businessType = BusinessType.DELETE)
-    @PostMapping("/webVersionOrderMessage")
-    public TableDataInfo webVersionOrderMessage(@RequestBody(required = false) TWarehouseBills tWarehouseBills){
+    @GetMapping("/webVersionOrderMessage")
+    public TableDataInfo webVersionOrderMessage(TWarehouseBills tWarehouseBills){
         startPage();
         LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        List<Map<String,Object>> warehouseBills = tWarehousebillsService.ruoYiVersionOrderList(loginUser,tWarehouseBills);
+        List<Map<String,Object>> warehouseBills = tWarehousebillsService.webVersionOrderMessage(loginUser,tWarehouseBills);
         return getDataTable(warehouseBills);
     }
     @PreAuthorize("@ss.hasPermi('warehouse:warehousebills:ruoYiVersionOrderList')")

+ 16 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/TCtnpriceItemsController.java

@@ -1,6 +1,8 @@
 package com.ruoyi.web.controller.shipping.controller;
 
 import java.util.List;
+
+import com.ruoyi.common.utils.StringUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -100,4 +102,18 @@ public class TCtnpriceItemsController extends BaseController
     {
         return toAjax(tCtnpriceItemsService.deleteTCtnpriceItemsByIds(fIds));
     }
+    @PostMapping("/containerPrice")
+    public AjaxResult containerPrice(@RequestBody TCtnpriceItems tCtnpriceItems)
+    {
+        if (StringUtils.isEmpty(tCtnpriceItems.getCntridName())){
+            return AjaxResult.error("集装箱编号不能为空");
+        }
+        if (tCtnpriceItems.getfPortofloadid() == null){
+            return AjaxResult.error("起始港不能为空");
+        }
+        if (tCtnpriceItems.getfDistinationid() == null){
+            return AjaxResult.error("目的港不能为空");
+        }
+        return AjaxResult.success(tCtnpriceItemsService.containerPrice(tCtnpriceItems));
+    }
 }

+ 33 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TCtnpriceItems.java

@@ -1,8 +1,10 @@
 package com.ruoyi.shipping.domain;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -40,6 +42,37 @@ public class TCtnpriceItems extends BaseEntity
     private List<String> cLoadDate;
     //集装箱编号
     private String cntridName;
+    //起始港
+    private Long fPortofloadid;
+    //目的港
+    private Long fDistinationid;
+    /** 预计开船日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date fEtd;
+
+    public Date getfEtd() {
+        return fEtd;
+    }
+
+    public void setfEtd(Date fEtd) {
+        this.fEtd = fEtd;
+    }
+
+    public Long getfPortofloadid() {
+        return fPortofloadid;
+    }
+
+    public void setfPortofloadid(Long fPortofloadid) {
+        this.fPortofloadid = fPortofloadid;
+    }
+
+    public Long getfDistinationid() {
+        return fDistinationid;
+    }
+
+    public void setfDistinationid(Long fDistinationid) {
+        this.fDistinationid = fDistinationid;
+    }
 
     public String getCntridName() {
         return cntridName;

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

@@ -94,4 +94,11 @@ public interface TCtnpriceItemsMapper
     public List<String> selectPriceMoney(@Param("fPortofloadid") Long fPortofloadid,
                               @Param("fDistinationid") Long fDistinationid,
                               @Param("fNo") String fNo);
+
+    /**
+     * 获取集装箱运费
+     * @param tCtnpriceItems
+     * @return
+     */
+    public List<Long> containerPrice(TCtnpriceItems tCtnpriceItems);
 }

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

@@ -58,4 +58,11 @@ public interface ITCtnpriceItemsService
      * @return 结果
      */
     public int deleteTCtnpriceItemsById(Long fId);
+
+    /**
+     * 获取集装箱运费
+     * @param tCtnpriceItems
+     * @return
+     */
+    public List<Long> containerPrice(TCtnpriceItems tCtnpriceItems);
 }

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

@@ -96,4 +96,9 @@ public class TCtnpriceItemsServiceImpl implements ITCtnpriceItemsService
     {
         return tCtnpriceItemsMapper.deleteTCtnpriceItemsById(fId);
     }
+
+    @Override
+    public List<Long> containerPrice(TCtnpriceItems tCtnpriceItems) {
+        return tCtnpriceItemsMapper.containerPrice(tCtnpriceItems);
+    }
 }

+ 13 - 0
ruoyi-shipping/src/main/resources/mapper/shipping/TCtnpriceItemsMapper.xml

@@ -147,5 +147,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	        AND tc.f_distinationid = #{fDistinationid}
 	        AND tr.f_no = #{fNo}
     </select>
+    <select id="containerPrice" parameterType="object" resultType="long">
+        SELECT
+            ti.f_price
+        FROM
+            t_ctnprice_items ti
+                LEFT JOIN t_cntr tc
+                          ON ti.f_cntrid = tc.f_id
+                LEFT JOIN t_ctnprice tp ON ti.f_pid = tp.f_id
+        WHERE tc.f_no = #{cntridName}
+          AND tp.f_portofloadid = #{fPortofloadid}
+          AND tp.f_distinationid = #{fDistinationid}
+          AND #{fEtd} BETWEEN tp.f_begindate AND tp.f_end
+    </select>
     
 </mapper>

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

@@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHEN tv.f_status = 'T' THEN
         '正常' ELSE '停用'
         END AS f_status,
-        TIMESTAMPDIFF(DAY,tv.f_ETD,DATE_FORMAT(tv.f_cutoffdate, '%Y-%m-%d %H:%i:%S')) closing,
+        TIMESTAMPDIFF(DAY,tv.f_ETD,DATE_FORMAT(tv.f_ducomentrayoffdate, '%Y-%m-%d %H:%i:%S')) closing,
         tv.create_by,
         tv.create_time,
         tv.update_by,
@@ -222,8 +222,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
             <if test="fPortofloadid != null">f_portofloadid = #{fPortofloadid},</if>
             <if test="fPortofdischargeid != null">f_portofdischargeid = #{fPortofdischargeid},</if>
+            <if test="fPortofdischargeid == null">f_portofdischargeid = null,</if>
             <if test="fDistinationid != null">f_distinationid = #{fDistinationid},</if>
             <if test="fPortoftransshipment != null">f_portoftransshipment = #{fPortoftransshipment},</if>
+            <if test="fPortoftransshipment == null">f_portoftransshipment = null,</if>
             <if test="fEtd != null">f_ETD = #{fEtd},</if>
             <if test="fAtd != null">f_ATD = #{fAtd},</if>
             <if test="fEta != null">f_ETA = #{fEta},</if>

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

@@ -451,8 +451,10 @@ public class TWarehouseBills extends BaseEntity {
     //箱量
     private Long fCntrcount;
     //开始时间
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date startTime;
     //结束时间
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date endTime;
     //箱号
     private String boxNumber;

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

@@ -1,6 +1,7 @@
 package com.ruoyi.warehouseBusiness.service.impl;
 
 
+import cn.hutool.core.bean.BeanUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -1349,8 +1350,14 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
 
     @Override
     public List<Map<String, Object>> webVersionOrderMessage(LoginUser loginUser, TWarehouseBills tWarehouseBills) {
-        //tWarehouseBills.setCreateBy(loginUser.getUser().getUserName());
-        return tWarehouseBillsMapper.ruoYiVersionOrderList(tWarehouseBills);
+        TWarehouseBills warehouseBills = new TWarehouseBills();
+        if (tWarehouseBills != null){
+            BeanUtil.copyProperties(tWarehouseBills,warehouseBills);
+            warehouseBills.setCreateBy(loginUser.getUser().getUserName());
+        }else {
+            warehouseBills.setCreateBy(loginUser.getUser().getUserName());
+        }
+        return tWarehouseBillsMapper.ruoYiVersionOrderList(warehouseBills);
     }
 
     @Override

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

@@ -1449,6 +1449,7 @@
                 and tw.create_time &lt;= #{timeInterval[1]}
             </if>
         </where>
+        ORDER BY tw.create_time DESC, tw.f_id DESC
     </select>
     <select id="ruoYiVersionOrderList" parameterType="TWarehousebills" resultType="map">
         SELECT
@@ -1630,6 +1631,7 @@
             </if>
             <if test="createBy != null  and createBy != ''">and tw.create_by = #{createBy}</if>
         </where>
+        ORDER BY tw.create_time DESC, tw.f_id DESC
     </select>
     <select id="webVersionOrderById" parameterType="TWarehousebills" resultMap="TWarehousebillsResult">
         SELECT tw.f_id,