From 0396aab3e51faadffcc02ab8879750b59cddb5bb Mon Sep 17 00:00:00 2001 From: ljw Date: Wed, 30 Oct 2024 18:26:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=201.=E5=8F=91=E8=BF=90=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E5=8D=95=E4=BF=9D=E5=AD=98=E7=94=9F=E6=88=90=E5=82=A8=E8=BF=90?= =?UTF-8?q?=E6=B1=87=E6=80=BB=202.=E5=86=85=E5=AE=A1=E9=A2=84=E7=AE=97?= =?UTF-8?q?=E5=8D=95=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 1986782dc4a30b5c8e52a49d852d4f0c13708b71) --- .../op/ShippingDetailsAuditOp.java | 116 ++++++++++-------- .../op/IntAuditBuSaAttachmentsContractOp.java | 15 ++- 2 files changed, 77 insertions(+), 54 deletions(-) diff --git a/src/main/java/com/yem/wm/es/shippingdetails/op/ShippingDetailsAuditOp.java b/src/main/java/com/yem/wm/es/shippingdetails/op/ShippingDetailsAuditOp.java index a4733593..2c2c1fc8 100644 --- a/src/main/java/com/yem/wm/es/shippingdetails/op/ShippingDetailsAuditOp.java +++ b/src/main/java/com/yem/wm/es/shippingdetails/op/ShippingDetailsAuditOp.java @@ -24,58 +24,20 @@ import static com.yem.wm.es.contractamtlist.util.FunUtil.getShipBills; * @description: 出运明细单 * @date 2023/10/18 */ -public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn -{ +public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn { @Override - public void onPreparePropertys(PreparePropertysEventArgs e) - { - e.getFieldKeys().add("yem_businesssort"); - e.getFieldKeys().add("yem_ifgift"); - e.getFieldKeys().add("yem_materiel"); - e.getFieldKeys().add("yem_resourcescode"); - e.getFieldKeys().add("yem_milltype"); - e.getFieldKeys().add("yem_materialname"); - e.getFieldKeys().add("yem_materialenname"); - e.getFieldKeys().add("yem_specification"); - e.getFieldKeys().add("yem_unit"); - e.getFieldKeys().add("yem_needqty"); - e.getFieldKeys().add("yem_sapricepriceclause"); - e.getFieldKeys().add("yem_sapriceclausebase"); - e.getFieldKeys().add("yem_saamtpriceclause"); - e.getFieldKeys().add("yem_samtpriceclauseba"); - e.getFieldKeys().add("yem_baseunit"); - e.getFieldKeys().add("yem_baseqty"); - e.getFieldKeys().add("yem_storageqty"); - e.getFieldKeys().add("yem_vehicleno"); - e.getFieldKeys().add("yem_contractno"); - e.getFieldKeys().add("id"); - e.getFieldKeys().add("yem_accessorytype"); - e.getFieldKeys().add("yem_volvotype"); - e.getFieldKeys().add("yem_accesmaterial"); - e.getFieldKeys().add("yem_acunit"); - e.getFieldKeys().add("yem_acallqty"); - e.getFieldKeys().add("yem_saleorderno_p"); - e.getFieldKeys().add("yem_arrearsamt"); - e.getFieldKeys().add("yem_arrearsamtapply"); - - e.getFieldKeys().add("yem_es_materialinfo"); - e.getFieldKeys().add("yem_billtype"); - e.getFieldKeys().add("yem_qty"); - e.getFieldKeys().add("yem_resourcenog"); - e.getFieldKeys().add("yem_es_salesorder_z"); - e.getFieldKeys().add("yem_iouamount"); + public void onPreparePropertys(PreparePropertysEventArgs e) { + e.getFieldKeys().addAll(this.billEntityType.getAllFields().keySet()); } @Override - public void onAddValidators(AddValidatorsEventArgs e) - { + public void onAddValidators(AddValidatorsEventArgs e) { super.onAddValidators(e); // e.addValidator(new ShippingDetailAuditValidator()); } @Override - public void endOperationTransaction(EndOperationTransactionArgs e) - { + public void endOperationTransaction(EndOperationTransactionArgs e) { DynamicObject[] dataEntities = e.getDataEntities(); for (DynamicObject dataEntitie : dataEntities) { dataEntitie = BusinessDataServiceHelper.loadSingle(dataEntitie.getPkValue(), dataEntitie.getDynamicObjectType().getName()); @@ -89,8 +51,7 @@ public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn * @description 审核时生成出运汇总分录 * @author power */ - public static void collect(DynamicObject dataEntitie) - { + public static void collect(DynamicObject dataEntitie) { DynamicObjectCollection materialinfos = dataEntitie.getDynamicObjectCollection("yem_es_materialinfo"); DynamicObjectCollection followcars = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_p"); DynamicObjectCollection collects = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_total"); @@ -99,12 +60,13 @@ public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn if (StringUtil.isNotEmpty(materialinfo.getString("yem_businesssort"))) { String businesssort = materialinfo.getString("yem_businesssort"); - if ("Z".equals(businesssort)) { + boolean yemIfgift = materialinfo.getBoolean("yem_ifgift"); + if ("Z".equals(businesssort)&&!yemIfgift) { DynamicObjectCollection completemachines = materialinfo.getDynamicObjectCollection("yem_es_salesorder_z"); for (DynamicObject completemachine : completemachines) { DynamicObject newEntryEntity = collects.addNew(); - newEntryEntity.set("yem_isgifit_tl", materialinfo.getBoolean("yem_ifgift")); + newEntryEntity.set("yem_isgifit_tl", yemIfgift); newEntryEntity.set("yem_classification_tl", businesssort); if (materialinfo.getDynamicObject("yem_materiel") != null) { newEntryEntity.set("yem_accesmaterial_tl", materialinfo.getLong("yem_materiel.id")); @@ -155,10 +117,10 @@ public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn newEntryEntity.set("yem_impactprice1", materialinfo.getString("yem_impactprice")); } } - if ("P".equals(businesssort)) { + if ("P".equals(businesssort)&&!yemIfgift) { DynamicObject newEntryEntity = collects.addNew(); - newEntryEntity.set("yem_isgifit_tl", materialinfo.getBoolean("yem_ifgift")); + newEntryEntity.set("yem_isgifit_tl", yemIfgift); newEntryEntity.set("yem_classification_tl", businesssort); if (materialinfo.getDynamicObject("yem_materiel") != null) { newEntryEntity.set("yem_accesmaterial_tl", materialinfo.getLong("yem_materiel.id")); @@ -202,6 +164,59 @@ public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn newEntryEntity.set("yem_constractioid_tl", materialinfo.getLong("id")); newEntryEntity.set("yem_constracteyid_tl", materialinfo.getLong("yem_sourceentryid")); + // 汇总影响调拨价 + newEntryEntity.set("yem_impactprice1", materialinfo.getString("yem_impactprice")); + } + if (yemIfgift){ + DynamicObject newEntryEntity = collects.addNew(); + + newEntryEntity.set("yem_isgifit_tl", yemIfgift); + newEntryEntity.set("yem_classification_tl", businesssort); + if (materialinfo.getDynamicObject("yem_materiel") != null) { + newEntryEntity.set("yem_accesmaterial_tl", materialinfo.getLong("yem_materiel.id")); + } + if (materialinfo.getDynamicObject("yem_resourcenog") != null) { + newEntryEntity.set("yem_resource_tl", materialinfo.getLong("yem_resourcenog.id")); + } + if (materialinfo.getDynamicObject("yem_productmodel") != null) { + newEntryEntity.set("yem_basicmodel_tl", materialinfo.getLong("yem_productmodel.id")); + } + if (StringUtil.isNotEmpty(materialinfo.getString("yem_materialname"))) { + newEntryEntity.set("yem_materialname_tl", materialinfo.getString("yem_materialname")); + } + if (StringUtil.isNotEmpty(materialinfo.getString("yem_materialenname"))) { + newEntryEntity.set("yem_materialenname_tl", materialinfo.getString("yem_materialenname")); + } + if (StringUtil.isNotEmpty(materialinfo.getString("yem_specification"))) { + newEntryEntity.set("yem_specification_tl", materialinfo.getString("yem_specification")); + } + if (materialinfo.getDynamicObject("yem_unit") != null) { + newEntryEntity.set("yem_acunit_tl", materialinfo.getLong("yem_unit.id")); + } + newEntryEntity.set("yem_qty_tl", materialinfo.getBigDecimal("yem_qty")); + newEntryEntity.set("yem_constractqty_tl", materialinfo.getBigDecimal("yem_needqty")); + //销售单价(价格条款) + newEntryEntity.set("yem_sapepeclause_tl", materialinfo.getBigDecimal("yem_sapricepriceclause")); + newEntryEntity.set("yem_sapecebase_tl", materialinfo.getBigDecimal("yem_sapriceclausebase")); + //销售金额(价格条款) + newEntryEntity.set("yem_saamtpecle_tl", materialinfo.getBigDecimal("yem_saamtpriceclause")); + newEntryEntity.set("yem_samtpeceba_tl", materialinfo.getBigDecimal("yem_samtpriceclauseba")); + + if (materialinfo.getDynamicObject("yem_baseunit") != null) { + newEntryEntity.set("yem_unitfieldbase_tl", materialinfo.getLong("yem_baseunit.id")); + } + newEntryEntity.set("yem_qtybase_tl", materialinfo.getBigDecimal("yem_baseqty")); + newEntryEntity.set("yem_storageqty_tl", materialinfo.getBigDecimal("yem_storageqty")); + + if (materialinfo.getDynamicObject("yem_materiel")!=null) { + newEntryEntity.set("yem_zjnumber_tl", materialinfo.getLong("yem_materiel.id")); + } + if (StringUtil.isNotEmpty(materialinfo.getString("yem_contractno"))) { + newEntryEntity.set("yem_constratnb_tl", materialinfo.getString("yem_contractno")); + } + newEntryEntity.set("yem_constractioid_tl", materialinfo.getLong("id")); + newEntryEntity.set("yem_constracteyid_tl", materialinfo.getLong("yem_sourceentryid")); + // 汇总影响调拨价 newEntryEntity.set("yem_impactprice1", materialinfo.getString("yem_impactprice")); } @@ -252,8 +267,7 @@ public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn * @time 2023/11/9 14:24 */ - public static void arrearsAmt(DynamicObject dataEntity) - { + public static void arrearsAmt(DynamicObject dataEntity) { String sourceBillType = dataEntity.getString("yem_sourcebilltype"); long sourceBillId = dataEntity.getLong("yem_sourcebillid"); DynamicObject saleOrder = BusinessDataServiceHelper.loadSingle(sourceBillId, sourceBillType); diff --git a/src/main/java/com/yem/wm/im/intauditbusa/op/IntAuditBuSaAttachmentsContractOp.java b/src/main/java/com/yem/wm/im/intauditbusa/op/IntAuditBuSaAttachmentsContractOp.java index 18849b1c..01a16e02 100644 --- a/src/main/java/com/yem/wm/im/intauditbusa/op/IntAuditBuSaAttachmentsContractOp.java +++ b/src/main/java/com/yem/wm/im/intauditbusa/op/IntAuditBuSaAttachmentsContractOp.java @@ -40,10 +40,19 @@ public class IntAuditBuSaAttachmentsContractOp extends AbstractOperationServiceP if (dataEntitie.getBoolean("yem_whethercontract")){ return; } - String selectfield = DynamicObjectUtil.getSelectfields("yem_es_salesorder", false); - DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle("yem_es_salesorder", selectfield + DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle("yem_es_salesorder", DynamicObjectUtil.getSelectfields("yem_es_salesorder", false) , new QFilter[]{new QFilter("id", QCP.equals, dataEntitie.getLong("yem_sourcebillid"))}); - uploadAttachment(dataEntitie,loadSingle); + if (loadSingle == null) { + DynamicObject salesorder = BusinessDataServiceHelper.loadSingle("yem_es_xsalesorder", DynamicObjectUtil.getSelectfields("yem_es_xsalesorder", false) + , new QFilter[]{new QFilter("id", QCP.equals, dataEntitie.getLong("yem_sourcebillid"))}); + if (salesorder != null) { +// DynamicObject yemExportcontractnum = BusinessDataServiceHelper.loadSingle("yem_es_salesorder", DynamicObjectUtil.getSelectfields("yem_es_salesorder", false) +// , new QFilter[]{new QFilter("billno", QCP.equals, salesorder.getString("yem_exportcontractnum"))}); + uploadAttachment(dataEntitie, salesorder); + } + }else { + uploadAttachment(dataEntitie, loadSingle); + } dataEntitie.set("yem_whethercontract",true); }