Browse Source

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

lazhaoqian 3 years ago
parent
commit
b0eabdac46

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

@@ -1,10 +1,12 @@
 package com.ruoyi.web.controller.shipping.controller;
 
 import java.io.*;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.alibaba.fastjson.JSONObject;
 import com.ruoyi.basicData.domain.TCorps;
 import com.ruoyi.basicData.service.ITCorpsService;
 import com.ruoyi.basicData.service.ITGoodsService;
@@ -12,22 +14,22 @@ import com.ruoyi.common.config.RuoYiConfig;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.common.utils.file.FileUtils;
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.framework.web.service.TokenService;
-import com.ruoyi.shipping.domain.TCntrno;
-import com.ruoyi.shipping.domain.TWarehousebillsCntritems;
+import com.ruoyi.shipping.domain.ShipperContList;
+import com.ruoyi.shipping.domain.ShipperDataVo;
+import com.ruoyi.shipping.domain.TResponseVo;
 import com.ruoyi.shipping.excel.TWarehousebillsCntritemsExcel;
 import com.ruoyi.shipping.service.ITWarehousebillsCntritemsService;
 import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
 import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
-import com.sun.jna.platform.unix.solaris.LibKstat;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.MediaType;
+import org.springframework.http.*;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.interceptor.TransactionAspectSupport;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
 import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
@@ -35,11 +37,9 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 /**
  * 凯和订单Controller
  *
@@ -266,6 +266,12 @@ public class KHTWarehousebillsController extends BaseController
         List<Map<String,Object>> warehouseBills = tWarehousebillsService.ruoYiVersionOrderList(loginUser,tWarehouseBills);
         return getDataTable(warehouseBills);
     }
+
+    @PostMapping("/pickUpEDI")
+    public AjaxResult pickUpEDI (TWarehouseBills tWarehouseBills) {
+        return tWarehousebillsService.ruoYiVersionOrderListNew(tWarehouseBills);
+    }
+
     //@PreAuthorize("@ss.hasPermi('warehouse:warehousebills:webVersionOrderDetails')")
     @Log(title = "凯和若依订单详情", businessType = BusinessType.DELETE)
     @PostMapping("/webVersionOrderDetails")

+ 15 - 0
ruoyi-common/src/main/java/com/ruoyi/common/exception/StorageFeeException.java

@@ -0,0 +1,15 @@
+package com.ruoyi.common.exception;
+
+/**
+ * @author caifc
+ * @date 2021-10-18 11:15
+ */
+public class StorageFeeException extends Exception {
+
+    /**
+     * @param msg 错误信息
+     */
+    public StorageFeeException(String msg) {
+        super(msg);
+    }
+}

+ 23 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java

@@ -2,6 +2,7 @@ package com.ruoyi.common.utils;
 
 import com.ruoyi.common.core.text.StrFormatter;
 
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
@@ -453,6 +454,28 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
         return Arrays.stream(strings).mapToInt(Integer::parseInt).toArray();
     }
 
+    /**
+     * 获取当前时间字符串
+     */
+    public static String nowTimeStr(){
+        // 获取用户当前登录时间
+        Date nowTime = new Date();
+        // 简单时间参数设定
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        // 将简单时间转换成字符串
+        return df.format(nowTime);
+    }
+
+    /**
+     * 转换时间字符串
+     */
+    public static String nowTimeStr(Object o) {
+        // 简单时间参数设定
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        // 将简单时间转换成字符串
+        return df.format(o);
+    }
+
     @SuppressWarnings("unchecked")
     public static <T> T cast(Object obj) {
         return (T) obj;

+ 31 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/ShipperContList.java

@@ -0,0 +1,31 @@
+package com.ruoyi.shipping.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 箱子列表参数
+ * Y:必填,N:非必填
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ShipperContList {
+    /** 箱号 Y */
+    private String containerNo;
+    /** 箱型 Y */
+    private String containerType;
+    /** 尺寸 Y */
+    private String containerSize;
+    /** 铅封号 Y */
+    private String sealno;
+    /** 单箱件数 N */
+    private String conPackages;
+    /** 单箱重量,最多四位小数 N */
+    private String conWeight;
+    /** 单箱体积,最多四位小数 N */
+    private String conVolume;
+    /** 拼箱类型(0: 整箱,1:拼箱) Y */
+    private String lclType;
+}

+ 113 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/ShipperDataVo.java

@@ -0,0 +1,113 @@
+package com.ruoyi.shipping.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+/**
+ * 船代系统请求参数实体
+ * Y:必填、N:非必填
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ShipperDataVo {
+    /** 提单号 Y */
+    private String billOfLadingNo;
+    /** 预约企业全称 Y */
+    private String orderEnterprise;
+    /** 预约企业社会统一编码 Y */
+    private String orderEnterpriseNo;
+    /** 收货人 Y */
+    private String consignee;
+    /** 收货地址 Y */
+    private String consigneeAddress;
+    /** 收货人电话 N */
+    private String consigneePersonPhone;
+    /** 提货单生成时间 Y,格式为 yyyy-mm-dd hh24:mi:ss */
+    private String billTime;
+    /** 换单企业全称(负责换单的船公司、船代在云港通注册时填写的准确全称) Y */
+    private String shipAgent;
+    /** 换单企业社会统一编码 Y */
+    private String shipAgentNo;
+    /** 押箱企业全称(负责换单的船公司、船代在云港通注册时填写的社会统一编码) Y */
+    private String contEnterprise;
+    /** 押箱企业社会统一编码(负责押箱的船公司、船代、场站押箱点在云港通注册时填写的社会统一编码) Y */
+    private String contEnterpriseNo;
+    /** 发送方全称 Y */
+    private String sendEnterprise;
+    /** 发送方类型(船代或船公司)1-船代,2-船公司,3-省电子口岸 Y */
+    private String sendType;
+    /** 换单操作员姓名 Y */
+    private String switchBillPerson;
+    /** 交付条款  cy-cy Y */
+    private String deliveryClause;
+    /** 合同号 N */
+    private String contractNo;
+    /** 提单类型,1-正本,2-电放,3-海运 N */
+    private String billType;
+    /** 到付海运费 N */
+    private String oceanFreight;
+    /** 币种(有到付海运费时必填) N */
+    private String currency;
+    /** 船公司全称 Y */
+    private String shipCompany;
+    /** 箱属公司码 Y */
+    private String xsgsm;
+    /** 进口关区 Y */
+    private String importZone;
+    /** 第一程运输 Y */
+    private String firstTrans;
+    /** 内外贸,N-内贸,W-外贸 Y */
+    private String tradeFlag;
+    /** 码头代码 Y */
+    private String mtdm;
+    /** 码头船名代码 */
+    private String mtVesselCode;
+    /** 码头船名编号 */
+    private String mtVoyageNumber;
+    /** 起运港 Y */
+    private String loadingPort;
+    /** 卸货港 Y */
+    private String dischargePort;
+    /** 目的地 N */
+    private String destination;
+    /** 卸货地点 N */
+    private String dischargePlace;
+    /** 到达日期(船舶抵港日期) Y */
+    private String arrivalDatetime;
+    /** 提单唛头(标记) Y */
+    private String billMark;
+    /** 中文船名,如果内贸没有英文船名,该字段上传中文船名 N */
+    private String vesselNameCn;
+    /** 英文船名(海关申报时用的英文船名) Y */
+    private String vesselNameEn;
+    /** 海关航次 Y */
+    private String voyageNumber;
+    /** 船舶IMO号 Y */
+    private String imo;
+    /** 货名 Y */
+    private String goodsName;
+    /** 件数 Y */
+    private String packages;
+    /** 件数单位 Y */
+    private String packagesUnit;
+    /** 重量 Y */
+    private String weight;
+    /** 重量单位(KGS) Y */
+    private String weightUnit;
+    /** 体积 Y */
+    private String volume;
+    /** 体积单位(CBM) Y */
+    private String volumeUnit;
+    /** 备注(换单备注) N */
+    private String transferRemark;
+    /** 集装箱数量箱型描述(格式) Y */
+    private String conDescribe;
+    /** 拼箱类型(0: 整箱,1:拼箱) Y */
+    private String lclType;
+    /** 箱子列表 */
+    private List<ShipperContList> contList;
+}

+ 14 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/domain/TResponseVo.java

@@ -0,0 +1,14 @@
+package com.ruoyi.shipping.domain;
+
+import lombok.Data;
+
+import java.util.Map;
+
+/**
+ * 凯和进口集装箱提货单电子化-船代-请求后返回数据实体
+ */
+@Data
+public class TResponseVo {
+    private Map<String,String> message;
+    private boolean success;
+}

+ 25 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/vo/StorageFeeCalculationResultVO.java

@@ -66,6 +66,31 @@ public class StorageFeeCalculationResultVO implements Serializable {
      */
     private List<TFees> feesList;
 
+    /**
+     * 未计费提单号提示
+     */
+    private String fMblnoMsg;
+
+    /**
+     * 未计费提单号提示数组
+     */
+    private List<String> fMblnoMsgList;
+
+    public String getfMblnoMsg() {
+        return fMblnoMsg;
+    }
+
+    public void setfMblnoMsg(String fMblnoMsg) {
+        this.fMblnoMsg = fMblnoMsg;
+    }
+
+    public List<String> getfMblnoMsgList() {
+        return fMblnoMsgList;
+    }
+
+    public void setfMblnoMsgList(List<String> fMblnoMsgList) {
+        this.fMblnoMsgList = fMblnoMsgList;
+    }
 
     public TWarehouseBills getWarehouseBills() {
         return warehouseBills;

+ 2 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseBillsService.java

@@ -391,6 +391,8 @@ public interface ITWarehouseBillsService {
      */
     public List<Map<String, Object>> ruoYiVersionOrderList(LoginUser loginUser, TWarehouseBills tWarehouseBills);
 
+    AjaxResult ruoYiVersionOrderListNew(TWarehouseBills tWarehouseBills);
+
     /**
      * 网站查询订单
      */

+ 3 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseAgreementServiceImpl.java

@@ -17,6 +17,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.exception.BaseException;
+import com.ruoyi.common.exception.StorageFeeException;
 import com.ruoyi.common.exception.WarehouseException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
@@ -551,7 +552,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
      * @return 结果
      * @author shanxin
      */
-    public StorageFeeCalculationResultVO getCarryingCost(CalculateStorageFeesDTO storageFeesDto) {
+    public StorageFeeCalculationResultVO getCarryingCost(CalculateStorageFeesDTO storageFeesDto) throws StorageFeeException {
         if (null == storageFeesDto.getfCorpid() ||
                 null == storageFeesDto.getfGoodsid() ||
                 null == storageFeesDto.getDays() ||
@@ -569,7 +570,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
                         String.valueOf(storageFeesDto.getWarehouseId()), storageFeesDto.getCangKey());
         // 如果未找到计费规则 则抛出异常
         if (CollUtil.isEmpty(itemList)) {
-            throw new WarehouseException("编号" + storageFeesDto.getfMblno() + "未找到计费规则");
+            throw new StorageFeeException(storageFeesDto.getfMblno());
         }
         // 如果仓储费出现两个不同计费单位就进行抛异常
         long count = itemList.stream().map(TWarehouseAgreementitems::getfFeeunitid).distinct().count();

+ 146 - 4
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.ruoyi.approvalFlow.domain.AuditItems;
-import com.ruoyi.approvalFlow.mapper.AuditItemsDoMapper;
 import com.ruoyi.approvalFlow.mapper.AuditItemsMapper;
 import com.ruoyi.approvalFlow.mapper.AuditItemsUsersMapper;
 import com.ruoyi.approvalFlow.service.impl.AuditItemsAbout;
@@ -22,6 +21,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.exception.BaseException;
+import com.ruoyi.common.exception.StorageFeeException;
 import com.ruoyi.common.exception.WarehouseException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.DictUtils;
@@ -67,7 +67,6 @@ import com.ruoyi.warehouseBusiness.mapper.*;
 import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
 import lombok.AllArgsConstructor;
 import org.apache.poi.hssf.usermodel.*;
-import org.apache.poi.ss.formula.functions.T;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.CellReference;
@@ -76,9 +75,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.*;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.*;
@@ -2965,6 +2968,127 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     }
 
     @Override
+    public AjaxResult ruoYiVersionOrderListNew(TWarehouseBills tWarehouseBills) {
+        List<Map<String,Object>> result = tWarehouseBillsMapper.ruoYiVersionOrderList(tWarehouseBills);
+        List<ShipperDataVo> list = new ArrayList<>();
+        for (Map<String,Object> map : result) {
+            // 新建实体
+            ShipperDataVo dataVo = new ShipperDataVo();
+            dataVo.setBillOfLadingNo((String) map.get("fBillno"));
+            dataVo.setOrderEnterprise((String) map.get("corpName"));
+            dataVo.setOrderEnterpriseNo("91370220334191898X");
+            dataVo.setConsignee((String) map.get("fConsigneername"));
+            dataVo.setConsigneeAddress((String) map.get("fConsigneername"));
+            dataVo.setConsigneePersonPhone((String) map.get("fConsigneetel"));
+            dataVo.setBillTime(StringUtils.nowTimeStr(map.get("createTime")));
+            dataVo.setShipAgent("青岛凯和志成");
+            dataVo.setShipAgentNo("BH1234678767");
+            dataVo.setSendEnterprise("青岛凯和志成");
+            dataVo.setSendType("2");
+            dataVo.setSwitchBillPerson("OP");
+            dataVo.setDeliveryClause((String) map.get("fServiceitems"));
+            //dataVo.setContractNo("HT2345678");
+            //dataVo.setBillType("A");
+            //dataVo.setOceanFreight("到付海运费");
+            //dataVo.setCurrency("币种");
+            dataVo.setShipCompany("青岛凯和志成");
+            dataVo.setXsgsm("GSM001");
+            dataVo.setImportZone("进口关区");
+            dataVo.setFirstTrans("第一程运输");
+            dataVo.setTradeFlag("N");
+            dataVo.setMtdm("QQCTN");
+            dataVo.setLoadingPort((String) map.get("loadportName"));
+            dataVo.setDischargePort((String) map.get("destportName"));
+            //dataVo.setDestination("目的地");
+            //dataVo.setDischargePlace("卸货地点");
+            dataVo.setArrivalDatetime((String) map.get("fEta"));
+            dataVo.setBillMark((String) map.get("fMarks"));
+            //dataVo.setVesselNameCn("中文船名");
+            dataVo.setVesselNameEn("KaiHeZhinCheng");
+            dataVo.setVoyageNumber((String) map.get("fVoyTwoName"));
+            dataVo.setImo("IMO001");
+            dataVo.setMtdm("TDH2345678");
+            dataVo.setMtVesselCode("QD22334455");
+            dataVo.setMtVoyageNumber("HC12345678");
+            dataVo.setGoodsName((String) map.get("goodsName"));
+            dataVo.setPackages("12");
+            dataVo.setPackagesUnit("吨");
+            dataVo.setWeight("12.3");
+            dataVo.setWeightUnit("吨");
+            dataVo.setVolume("23.1");
+            dataVo.setVolumeUnit("体积单位");
+            //dataVo.setTransferRemark("备注(换单备注)");
+            dataVo.setConDescribe((String) map.get("fNo"));
+            dataVo.setLclType("0");
+            List<ShipperContList> contLists = new ArrayList<>();
+
+            //配箱信息
+            TWarehousebillsCntritems warehousebillsCntritems = new TWarehousebillsCntritems();
+            warehousebillsCntritems.setfPid(Long.valueOf(map.get("fId").toString()));
+            List<TWarehousebillsCntritems> tWarehousebillsCntritems = tWarehousebillsCntritemsMapper.selectTWarehousebillsCntritemsList(warehousebillsCntritems);
+            if (CollectionUtils.isNotEmpty(tWarehousebillsCntritems)) {
+                for (TWarehousebillsCntritems cntritems : tWarehousebillsCntritems) {
+                    ShipperContList contList = new ShipperContList();
+                    contList.setContainerNo(cntritems.getfCntrno());
+                    contList.setContainerType(cntritems.getfCntrid().toString());
+                    contList.setContainerSize(cntritems.getfPackageid());
+                    contList.setSealno(cntritems.getfSealno());
+                    //contList.setConPackages("12");
+                    //contList.setConWeight("1.2");
+                    //contList.setConVolume("21");
+                    contList.setLclType("0");
+                    contLists.add(contList);
+                }
+            }
+            dataVo.setContList(contLists);
+            // list.add(dataVo);
+            String json = JSONObject.toJSONString(dataVo);
+            System.err.println("json:" + json);
+            //String jsonStr = JSONObject.toJSONString(dataVo);
+            // 请求路径 (测试)
+            // String postUrl = "https://api.qingdao-port.net/container/web/eir/edo/shipagent/insertEdo.do";
+            String postUrl = "https://api.qingdao-port.net/container/web/eir/edo/shipagent/insertEdo.do";
+            // 请求路径 (正式)
+            //String postUrl = "https://api.qingdao-port.net/container/web/wlds_eir/edo/shipagent/insertEdo.do";
+            // 请求参数
+            Map<String,String> params = new HashMap<>();
+            params.put("customerCode","A00001");
+            params.put("sign","abcdef");
+            params.put("reqTime",StringUtils.nowTimeStr());
+            params.put("data",json);
+            System.err.println(params);
+            TResponseVo responseVo = sendPostRequest(postUrl,params);
+            System.err.println(responseVo);
+            if (!responseVo.isSuccess()) {
+                return AjaxResult.error(responseVo.getMessage().get("msg"));
+            } else {
+                return AjaxResult.success(responseVo.getMessage().get("msg"));
+            }
+        }
+        // String json = JSONObject.toJSONString(list);
+        return AjaxResult.success("成功");
+    }
+
+    /**
+     * 向目的 URL 发送 post 请求
+     * @param url 目的 url
+     * @param params 发送的参数
+     * @return ResponseVo
+     */
+    public static TResponseVo sendPostRequest(String url, Map<String,String> params) {
+        RestTemplate client = new RestTemplate();
+        HttpHeaders headers = new HttpHeaders();
+        HttpMethod method = HttpMethod.POST;
+        // 以表单的方式提交
+        headers.setContentType(MediaType.APPLICATION_JSON);
+        // 将请求头部和参数合成一个请求
+        HttpEntity<Map<String,String>> requestEntity = new HttpEntity<>(params,headers);
+        // 执行 HTTP 请求,将返回的结构使用 ResponseVo 类格式化
+        ResponseEntity<TResponseVo> response = client.exchange(url, method, requestEntity, TResponseVo.class);
+        return response.getBody();
+    }
+
+    @Override
     public List<Map<String, Object>> webVersionOrderMessage(LoginUser loginUser, TWarehouseBills tWarehouseBills) {
         TWarehouseBills warehouseBills = new TWarehouseBills();
         if (tWarehouseBills != null) {
@@ -4551,6 +4675,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         // 获取税率
         List<SysDictData> taxRate = sysDictDataMapper.selectDictDataByType("tax_rate");
 
+        List<String> fMblnoMsgList = new ArrayList<>();
         for (CalculateStorageFeesInfoVO item : feesInfoVOList) {
             // 交以计算明细计费方式必填
             if (StringUtils.isNull(item.getFBillingway())) {
@@ -4611,7 +4736,13 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             storageFeesDto.setfNetweight(item.getFNetweight());
             storageFeesDto.setfGrossweight(item.getFGrossweight());
             // 仓储费协议计算
-            StorageFeeCalculationResultVO feeCalculationResultVO = tWarehouseAgreementService.getCarryingCost(storageFeesDto);
+            StorageFeeCalculationResultVO feeCalculationResultVO = null;
+            try {
+                feeCalculationResultVO = tWarehouseAgreementService.getCarryingCost(storageFeesDto);
+            } catch (StorageFeeException e) {
+                fMblnoMsgList.add(e.getMessage());
+            }
+
             if (Objects.isNull(feeCalculationResultVO)) {
                 continue;
             }
@@ -4665,6 +4796,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         }
         resultVO.setAmt(sumAmt);
         resultVO.setItemFeesList(itemsList);
+        resultVO.setfMblnoMsgList(fMblnoMsgList);
         return resultVO;
     }
 
@@ -4726,6 +4858,8 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         tWarehouseBills.setfId(null);
         List<CalculateStorageFeesInfoVO> feesInfoVOList = tWarehousebillsitemsMapper.selectStorageFeeItemList1(tWarehouseBills);
         tWarehouseBills.setfId(fPid);
+
+        List<String> fMblnoMsgList = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(feesInfoVOList)) {
             StorageFeeCalculationResultVO resultVO = getWarehouseItems(tWarehouseBills, feesInfoVOList, loginUser, cangKey);
             if (CollectionUtils.isNotEmpty(resultVO.getItemFeesList())) {
@@ -4737,6 +4871,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 });
                 itemsList = resultVO.getItemFeesList();
             }
+            fMblnoMsgList.addAll(resultVO.getfMblnoMsgList());
         }
         List<CalculateStorageFeesInfoVO> whgenlegfeesInfoVOList = tWhgenlegMapper.selectStorageFeeItemList1(tWarehouseBills);
         if (CollectionUtils.isNotEmpty(whgenlegfeesInfoVOList)) {
@@ -4754,6 +4889,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                     itemsList.add(li);
                 }
             }
+            fMblnoMsgList.addAll(resultVO.getfMblnoMsgList());
         }
         TFees tFees = new TFees();
         tFees.setfStatus("2");
@@ -4765,6 +4901,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         calculationResultVO.setFeesList(feesList);
         calculationResultVO.setWarehouseBills(tWarehouseBills);
         calculationResultVO.setWarehouseItemList(itemsList);
+        calculationResultVO.setfMblnoMsg(fMblnoMsgList.stream().distinct().collect(Collectors.joining(",")));
         return AjaxResult.success(calculationResultVO);
     }
 
@@ -5043,7 +5180,12 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             storageFeesDto.setfNetweight(new BigDecimal(String.valueOf(item.get("fNetweight"))));
             storageFeesDto.setfGrossweight(new BigDecimal(String.valueOf(item.get("fGrossweight"))));
             // 计算仓储费明细
-            StorageFeeCalculationResultVO carryingCost = tWarehouseAgreementService.getCarryingCost(storageFeesDto);
+            StorageFeeCalculationResultVO carryingCost = null;
+            try {
+                carryingCost = tWarehouseAgreementService.getCarryingCost(storageFeesDto);
+            } catch (StorageFeeException e) {
+                throw new WarehouseException("编号" + e.getMessage() + "未找到计费规则");
+            }
             if (StringUtils.isNull(carryingCost)) {
                 continue;
             }

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

@@ -1974,6 +1974,9 @@
         sd.dict_label fServiceitems,
         tk.dict_label fDestportMode,
         tw.f_consigneername fConsigneername,
+        tw.f_consigneetel fConsigneetel,
+        tw.f_eta fEta,
+        tw.f_marks fMarks,
         ta.f_name fName,
         tw.f_bsdate fBsdate,
         ty.f_ATD fAtd,