From 1d42c39d8cf60ca195c9ebddf6e479a6b5911b8f Mon Sep 17 00:00:00 2001 From: violet Date: Thu, 5 Sep 2024 20:44:19 +0800 Subject: [PATCH 1/6] =?UTF-8?q?change:=E6=8A=A5=E8=A1=A8=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompleteShipDetailReportPlugin.java | 7 +++-- .../ITCOrderDetailsReportPlugin.java | 7 +++-- .../SalesCommissionReportPlugin.java | 7 +++-- src/main/java/com/yem/rf/utils/RFUtils.java | 31 +++++++++++++++++++ 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/yem/rf/salescommission/CompleteShipDetailReportPlugin.java b/src/main/java/com/yem/rf/salescommission/CompleteShipDetailReportPlugin.java index 22f7bc54..e87d4767 100644 --- a/src/main/java/com/yem/rf/salescommission/CompleteShipDetailReportPlugin.java +++ b/src/main/java/com/yem/rf/salescommission/CompleteShipDetailReportPlugin.java @@ -20,8 +20,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; -import static com.yem.rf.utils.RFUtils.formatDate; -import static com.yem.rf.utils.RFUtils.getBaseQFilter; +import static com.yem.rf.utils.RFUtils.*; /** * @Description: 整机发运明细表 @@ -107,6 +106,10 @@ public class CompleteShipDetailReportPlugin extends AbstractReportListDataPlugin if (producttype > 0) { qFilter.and("yem_bd_products.id", "=", producttype); } + List fproducttypem = getFBaseDataIds(filter, "yem_fproducttypem"); + if (!fproducttypem.isEmpty()) { + qFilter.and("yem_bd_products.id", "IN", fproducttypem); + } ArrayList selectfields = Lists.newArrayList(); selectfields.add("yem_es_materialinfo.id main_detail_id"); selectfields.add("id main_id"); diff --git a/src/main/java/com/yem/rf/salescommission/ITCOrderDetailsReportPlugin.java b/src/main/java/com/yem/rf/salescommission/ITCOrderDetailsReportPlugin.java index 0ff97d0a..7939eaf7 100644 --- a/src/main/java/com/yem/rf/salescommission/ITCOrderDetailsReportPlugin.java +++ b/src/main/java/com/yem/rf/salescommission/ITCOrderDetailsReportPlugin.java @@ -17,8 +17,7 @@ import kd.bos.servicehelper.QueryServiceHelper; import java.math.BigDecimal; import java.util.*; -import static com.yem.rf.utils.RFUtils.formatDate; -import static com.yem.rf.utils.RFUtils.getBaseQFilter; +import static com.yem.rf.utils.RFUtils.*; /** * @Description: TODO @@ -107,6 +106,10 @@ public class ITCOrderDetailsReportPlugin extends AbstractReportListDataPlugin { sb.append(" AND yem_products = ").append(producttype); } + List fproducttypem = getFBaseDataIds(filter, "yem_fproducttypem"); + String concated = concatFBaseDataFilter(fproducttypem, "yem_products"); + sb.append(concated); + resDataSet = resDataSet.addField("0.0", "yem_inventoryqty"); DataSet where = resDataSet.where(sb.toString()); diff --git a/src/main/java/com/yem/rf/salescommission/SalesCommissionReportPlugin.java b/src/main/java/com/yem/rf/salescommission/SalesCommissionReportPlugin.java index c96ca59f..9263dcd6 100644 --- a/src/main/java/com/yem/rf/salescommission/SalesCommissionReportPlugin.java +++ b/src/main/java/com/yem/rf/salescommission/SalesCommissionReportPlugin.java @@ -18,8 +18,7 @@ import java.util.List; import static com.yem.rf.salescommission.CompleteShipDetailReportPlugin.queryGathering_ClaimDate; import static com.yem.rf.salescommission.CompleteShipDetailReportPlugin.querySalesOrder_PayRate; -import static com.yem.rf.utils.RFUtils.formatDate; -import static com.yem.rf.utils.RFUtils.getBaseQFilter; +import static com.yem.rf.utils.RFUtils.*; /** * @Description: TODO @@ -116,6 +115,10 @@ public class SalesCommissionReportPlugin extends AbstractReportListDataPlugin { where.append(" AND yem_salesman = ").append(foperator); } + List fproducttypem = getFBaseDataIds(filter, "yem_fproducttypem"); + String concated = concatFBaseDataFilter(fproducttypem, "yem_products"); + where.append(concated); + resDataSet = resDataSet.where(where.toString()); return resDataSet; diff --git a/src/main/java/com/yem/rf/utils/RFUtils.java b/src/main/java/com/yem/rf/utils/RFUtils.java index eee15e20..34823435 100644 --- a/src/main/java/com/yem/rf/utils/RFUtils.java +++ b/src/main/java/com/yem/rf/utils/RFUtils.java @@ -1,10 +1,12 @@ package com.yem.rf.utils; +import com.yem.wm.utils.YEM; import kd.bos.algo.DataSet; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.metadata.IDataEntityProperty; import kd.bos.dataentity.metadata.clr.DataEntityPropertyCollection; +import kd.bos.entity.report.FilterInfo; import kd.bos.orm.ORM; import kd.bos.orm.query.QFilter; @@ -87,4 +89,33 @@ public class RFUtils { } return list; } + + public static List getFBaseDataIds(FilterInfo filter, String propName) { + List ids = new ArrayList<>(); + DynamicObjectCollection collection = filter.getDynamicObjectCollection(propName); + for (DynamicObject d : collection) { + long id = d.getLong("id"); + ids.add(id); + } + return ids; + } + + public static String concatFBaseDataFilter(List ids, String propName) { + StringBuilder sb = new StringBuilder(); + if (YEM.isNotEmpty(ids)) { + sb.append(" AND ").append(propName).append(" IN ("); + + for (Long i : ids) { + int idx = ids.indexOf(i); + if (idx == ids.size() - 1) { + sb.append(i); + } else { + sb.append(i).append(","); + } + } + + sb.append(")"); + } + return sb.toString(); + } } From fc33b58c8ebd80f27d43409ba48c50e3528808b6 Mon Sep 17 00:00:00 2001 From: violet Date: Thu, 5 Sep 2024 21:39:16 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=E6=8A=A5=E8=A1=A8=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yem/rf/utils/RFUtils.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/yem/rf/utils/RFUtils.java b/src/main/java/com/yem/rf/utils/RFUtils.java index 34823435..547288ba 100644 --- a/src/main/java/com/yem/rf/utils/RFUtils.java +++ b/src/main/java/com/yem/rf/utils/RFUtils.java @@ -93,9 +93,11 @@ public class RFUtils { public static List getFBaseDataIds(FilterInfo filter, String propName) { List ids = new ArrayList<>(); DynamicObjectCollection collection = filter.getDynamicObjectCollection(propName); - for (DynamicObject d : collection) { - long id = d.getLong("id"); - ids.add(id); + if (collection != null) { + for (DynamicObject d : collection) { + long id = d.getLong("id"); + ids.add(id); + } } return ids; } From a97d42f8129933fcd48c5b26ffd6d41049b47451 Mon Sep 17 00:00:00 2001 From: violet Date: Thu, 5 Sep 2024 22:11:12 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix:=E5=9B=BD=E8=B4=B8=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ITCOrderDetailsReportPlugin.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/yem/rf/salescommission/ITCOrderDetailsReportPlugin.java b/src/main/java/com/yem/rf/salescommission/ITCOrderDetailsReportPlugin.java index 7939eaf7..6e819c85 100644 --- a/src/main/java/com/yem/rf/salescommission/ITCOrderDetailsReportPlugin.java +++ b/src/main/java/com/yem/rf/salescommission/ITCOrderDetailsReportPlugin.java @@ -171,16 +171,8 @@ public class ITCOrderDetailsReportPlugin extends AbstractReportListDataPlugin { selectfields.add("yem_shippingplan_entry.yem_plandetail_entry.id order_plan_detail_id");//跟单任务明细子分录ID selectfields.add("yem_shippingplan_entry.yem_plandetail_entry.yem_srcentryid order_detail_id_plan_fk"); - DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_es_salesorder", String.join(",", selectfields), qFilter.toArray()); - DataSet proReqBill = queryOrderProReqBill(param); - - dataSet = dataSet.leftJoin(proReqBill) - .on("order_plan_id", "order_req_main_detail_fk") - .select(RptUtil.getDataSetFiledAlias(dataSet), RptUtil.getDataSetFiledAlias(proReqBill)) - .finish(); - - return dataSet; + return ORM.create().queryDataSet(algoKey, "yem_es_salesorder", String.join(",", selectfields), qFilter.toArray()); } private DataSet queryOrderProReqBill(ReportQueryParam param) { @@ -240,11 +232,22 @@ public class ITCOrderDetailsReportPlugin extends AbstractReportListDataPlugin { private DataSet queryTrackTaskConsoleProcEntry(ReportQueryParam param) { List selectfields = new ArrayList<>(); + selectfields.add("yem_es_salesorder_r.id task_order_plan_id"); selectfields.add("yem_es_salesorder_r.yem_entrtyid plan_proc_detail_fk"); selectfields.add("yem_es_salesorder_r.yem_stockway yem_ifreform"); // selectfields.add("TO_CHAR(yem_es_salesorder_r.yem_yieldetacdate, 'yyyy-MM-dd') yem_prodfeedbackdate");//预计完成时间 selectfields.add("TO_CHAR(yem_es_salesorder_r.yem_yieldfactacdate, 'yyyy-MM-dd') yem_plancompdate");//实际完成时间 - return ORM.create().queryDataSet(algoKey, "yem_tracktaskconsole", String.join(",", selectfields), null); + + DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_tracktaskconsole", String.join(",", selectfields), null); + + DataSet proReqBill = queryOrderProReqBill(param); + + dataSet = dataSet.leftJoin(proReqBill) + .on("task_order_plan_id", "order_req_main_detail_fk") + .select(RptUtil.getDataSetFiledAlias(dataSet), RptUtil.getDataSetFiledAlias(proReqBill)) + .finish(); + + return dataSet; } /** From b5900ccd560f31469f2b3e96212609073f0e30ea Mon Sep 17 00:00:00 2001 From: "zzs01@yunemao.com" Date: Fri, 6 Sep 2024 10:22:15 +0800 Subject: [PATCH 4/6] =?UTF-8?q?change:=E6=95=B4=E6=9C=BA=E5=8F=91=E8=BF=90?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompleteShipDetailReportPlugin.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/yem/rf/salescommission/CompleteShipDetailReportPlugin.java b/src/main/java/com/yem/rf/salescommission/CompleteShipDetailReportPlugin.java index e87d4767..2883504b 100644 --- a/src/main/java/com/yem/rf/salescommission/CompleteShipDetailReportPlugin.java +++ b/src/main/java/com/yem/rf/salescommission/CompleteShipDetailReportPlugin.java @@ -60,6 +60,8 @@ public class CompleteShipDetailReportPlugin extends AbstractReportListDataPlugin Date start = filter.getDate("yem_fshipdate_start"); Date end = filter.getDate("yem_fshipdate_end"); + String fisshiped = filter.getString("yem_fisshiped"); + StringBuilder sb = new StringBuilder(); sb.append("1=1"); if (YEM.isNotEmpty(start)) { @@ -68,6 +70,14 @@ public class CompleteShipDetailReportPlugin extends AbstractReportListDataPlugin if (YEM.isNotEmpty(end)) { sb.append(" AND TO_DATE(yem_shipdate, 'yyyy-MM-dd') <= ").append(String.format("TO_DATE('%s','yyyy-MM-dd')", formatDate(end))); } + if (YEM.isNotEmpty(fisshiped)) { + if ("A".equals(fisshiped)) {//已发货 + sb.append(" AND yem_dnbillno IS NOT NULL AND yem_dnbillno != '' "); + } + if ("B".equals(fisshiped)) {//未发货 + sb.append(" AND yem_dnbillno IS NULL OR yem_dnbillno = ''"); + } + } dataSet = dataSet.where(sb.toString()); From 13f5145fc2e091a5bd3d91f8a436f4b69081aba0 Mon Sep 17 00:00:00 2001 From: ljw Date: Fri, 6 Sep 2024 10:45:02 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=98=8E=E7=BB=86=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../materialPriceingPlugin.java | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/main/java/com/yem/wm/im/materialpriceing/materialPriceingPlugin.java diff --git a/src/main/java/com/yem/wm/im/materialpriceing/materialPriceingPlugin.java b/src/main/java/com/yem/wm/im/materialpriceing/materialPriceingPlugin.java new file mode 100644 index 00000000..1b6619c6 --- /dev/null +++ b/src/main/java/com/yem/wm/im/materialpriceing/materialPriceingPlugin.java @@ -0,0 +1,74 @@ +package com.yem.wm.im.materialpriceing; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.datamodel.IDataModel; +import kd.bos.entity.datamodel.events.ChangeData; +import kd.bos.entity.datamodel.events.PropertyChangedArgs; + +import java.math.BigDecimal; + +/** + * @author ljw + * @date 2024/9/6 10:05 + * @description materialPriceingPlugin + */ +public class materialPriceingPlugin extends AbstractBillPlugIn { + @Override + public void propertyChanged(PropertyChangedArgs e) { + super.propertyChanged(e); + super.propertyChanged(e); + String name = e.getProperty().getName(); + ChangeData[] changeSet = e.getChangeSet(); + switch (name) { + case "yem_from": + yemFrom(e); + break; + case "yem_reach": + yemReach(e); + break; + } + } + + /** + * 至不允许小于等于从 + * + * @param e + */ + private void yemReach(PropertyChangedArgs e) { + ChangeData changeData = e.getChangeSet()[0]; + int rowIndex = changeData.getRowIndex(); + int parentRowIndex = changeData.getParentRowIndex(); + BigDecimal newValue = (BigDecimal) changeData.getNewValue(); + DynamicObjectCollection yemBdLogistics = this.getModel().getEntryEntity("yem_entryentity"); + BigDecimal bigDecimal = yemBdLogistics.get(parentRowIndex).getDynamicObjectCollection("yem_subentryentity").get(rowIndex).getBigDecimal("yem_from"); + if (bigDecimal.compareTo(newValue) >= 0) { + + this.getModel().setValue("yem_reach",0,rowIndex,parentRowIndex); + + this.getView().showMessage("至不允许小于等于从!!!"); + } + } + + /** + * 从不能小于前一行的至 + * + * @param e + */ + private void yemFrom(PropertyChangedArgs e) { + ChangeData changeData = e.getChangeSet()[0]; + int rowIndex = changeData.getRowIndex(); + if (rowIndex - 1 < 0) { + return; + } + int parentRowIndex = changeData.getParentRowIndex(); + BigDecimal newValue = (BigDecimal) changeData.getNewValue(); + DynamicObjectCollection yemBdLogistics = this.getModel().getEntryEntity("yem_entryentity"); + BigDecimal bigDecimal = yemBdLogistics.get(parentRowIndex).getDynamicObjectCollection("yem_subentryentity").get(rowIndex - 1).getBigDecimal("yem_reach"); + if (bigDecimal.compareTo(newValue) > 0) { + + this.getModel().setValue("yem_from",0,rowIndex,parentRowIndex); + this.getView().showMessage("从不能小于前一行的至!!!"); + } + } +} From 50f064526527019d207b92b034c44a284538e042 Mon Sep 17 00:00:00 2001 From: ljw Date: Fri, 6 Sep 2024 11:40:36 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=8F=91=E8=BF=90=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=A1=A8=EF=BC=88=E6=8F=90=E6=88=90=EF=BC=89=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yem/rf/salescommission/ShipmentsChedulePlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/yem/rf/salescommission/ShipmentsChedulePlugin.java b/src/main/java/com/yem/rf/salescommission/ShipmentsChedulePlugin.java index 2ce5c164..09dde9cd 100644 --- a/src/main/java/com/yem/rf/salescommission/ShipmentsChedulePlugin.java +++ b/src/main/java/com/yem/rf/salescommission/ShipmentsChedulePlugin.java @@ -95,7 +95,7 @@ public class ShipmentsChedulePlugin extends AbstractReportListDataPlugin { StringBuilder sb = new StringBuilder(); - sb.append("yem_customsdeclaration1 = 'A'"); + sb.append("yem_customsdeclaration1 = 'B'"); if (YEM.isNotEmpty(yemContract)) { sb.append(" AND yem_contractnumber like '").append("%").append(yemContract).append("%").append("'"); }