From e04dd91174c839ccdfeb6f45a50670e62ed28542 Mon Sep 17 00:00:00 2001 From: "zzs01@yunemao.com" Date: Tue, 10 Sep 2024 17:18:11 +0800 Subject: [PATCH] =?UTF-8?q?wip:=E6=95=B4=E6=9C=BA=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wm/im/clientdemand/utils/ClientUtils.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/main/java/com/yem/wm/im/clientdemand/utils/ClientUtils.java b/src/main/java/com/yem/wm/im/clientdemand/utils/ClientUtils.java index 4e2eb229..aa5a0024 100644 --- a/src/main/java/com/yem/wm/im/clientdemand/utils/ClientUtils.java +++ b/src/main/java/com/yem/wm/im/clientdemand/utils/ClientUtils.java @@ -2,6 +2,7 @@ package com.yem.wm.im.clientdemand.utils; import com.sun.tools.doclets.formats.html.resources.standard; import com.yem.tws.common1.BigDecimalUtils; +import com.yem.wm.utils.DynamicObjectUtil; import com.yem.wm.utils.YEM; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; @@ -11,6 +12,7 @@ import kd.bos.form.IFormView; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.QueryServiceHelper; import org.apache.commons.lang3.ArrayUtils; import java.math.BigDecimal; @@ -1875,6 +1877,45 @@ public class ClientUtils { } } } + + /** + * 查询物流价格核算表 + * + * @param transportStyle 运输方式 + * @param port 港口 + * @param billingMethod 计费方式 + * @return + */ + public static BigDecimal queryLogisticsCosts(long transportStyle, long port, long billingMethod) { + QFilter qFilter = new QFilter("status", "=", "C"); + qFilter.and("yem_entryentity.yem_shippingmethod.id", "=", transportStyle); + qFilter.and("yem_entryentity.yem_port.id", "=", port); + qFilter.and("yem_entryentity.yem_billingmethod.id", "=", billingMethod); + DynamicObject single = BusinessDataServiceHelper.loadSingle("yem_materialpriceing", qFilter.toArray()); + DynamicObjectCollection entry = single.getDynamicObjectCollection("yem_entryentity"); + for (DynamicObject d : entry) { + long e_transportStyle = d.getLong("yem_shippingmethod"); + long e_port = d.getLong("yem_port"); + long e_billingMethod = d.getLong("yem_billingmethod"); + + if (e_transportStyle == transportStyle && e_port == port && e_billingMethod == billingMethod) { + return d.getBigDecimal("yem_price"); + } + } + return BigDecimal.ZERO; + } + + public static BigDecimal queryLogisticsCosts(IDataModel model, int idx) { + return queryLogisticsCosts(model.getDataEntity(true), idx); + } + + private static BigDecimal queryLogisticsCosts(DynamicObject dataEntity, int idx) { + DynamicObjectCollection materialinfo = dataEntity.getDynamicObjectCollection("yem_es_materialinfo"); + for (DynamicObject d : materialinfo) { + + } + return null; + } }