diff --git a/lc123/cloud/app/plugin/form/pm/PurApplyBillPlugin.java b/lc123/cloud/app/plugin/form/pm/PurApplyBillPlugin.java index 84e0279..8c46719 100644 --- a/lc123/cloud/app/plugin/form/pm/PurApplyBillPlugin.java +++ b/lc123/cloud/app/plugin/form/pm/PurApplyBillPlugin.java @@ -507,8 +507,12 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin { taxrate2 = taxrate1.getBigDecimal("taxrate"); } DynamicObject materialpurchaseinfo = BusinessDataServiceHelper.loadSingle("bd_materialpurchaseinfo", new QFilter[]{new QFilter("masterid", QCP.equals, tqq9_material.getLong("id"))});//物料采购信息 + QFilter f1 = new QFilter("tqq9_mater.number", "=", tqq9_material.getString("number")); + QFilter f5 = new QFilter("tqq9_isauto", "=", true); + DynamicObject goods = BusinessDataServiceHelper.loadSingle("tqq9_goodspackage", new QFilter[]{f1, f5});//商品 BigDecimal tqq9_saledates = entry.getBigDecimal("tqq9_saledates"); model.setValue("material", materialpurchaseinfo, i);//物料 + model.setValue("tqq9_goods", goods, i);//商品 model.setValue("materialmasterid", tqq9_material, i);//主物料(封存) model.setValue("materialname", tqq9_material.getString("name"), i);//物料名称 model.setValue("unit", tqq9_material.getDynamicObject("baseunit"), i);//计量单位 diff --git a/lc123/cloud/app/plugin/form/pm/PurSuggestRptFromPlugin.java b/lc123/cloud/app/plugin/form/pm/PurSuggestRptFromPlugin.java index 713bc04..cb26a03 100644 --- a/lc123/cloud/app/plugin/form/pm/PurSuggestRptFromPlugin.java +++ b/lc123/cloud/app/plugin/form/pm/PurSuggestRptFromPlugin.java @@ -21,6 +21,7 @@ import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.QueryServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.sdk.plugin.Plugin; import java.math.BigDecimal; @@ -262,8 +263,6 @@ public class PurSuggestRptFromPlugin extends AbstractFormPlugin implements Plugi materialpackageDataSet = materialpackageDataSet.leftJoin(saloutbillDataSet).on("tqq9_materialinventoryinfo", "tqq9_materialinventoryinfo").on("tqq9_org", "tqq9_org").select("tqq9_material", "tqq9_sku_lc", "tqq9_org", "tqq9_purordermaterial", "tqq9_materialinventoryinfo", "tqq9_onsale_sh", "tqq9_onsale_bj", "tqq9_onsale_gz", "tqq9_purchaser_sh", "tqq9_purchaser_bj", "tqq9_purchaser_gz", "tqq9_shinventory", "tqq9_bjinventory", "tqq9_gzinventory", "tqq9_cdinventory", "tqq9_totalinventory", "tqq9_permonthsales_sh", "tqq9_permonthsales_bj", "tqq9_permonthsales_gz", "tqq9_permonthsales_cd", "tqq9_totalqty_sh", "tqq9_totalqty_bj", "tqq9_totalqty_gz", "tqq9_totalqty_cd").finish().addField("case when tqq9_org= " + sh + " then tqq9_totalqty_sh when tqq9_org= " + bj + " then tqq9_totalqty_bj when tqq9_org= " + gz + " then tqq9_totalqty_gz when tqq9_org= " + cd + " then tqq9_totalqty_cd else 0 end", "tqq9_totalqty").addField("case when tqq9_org= " + sh + " then tqq9_permonthsales_sh when tqq9_org= " + bj + " then tqq9_permonthsales_bj when tqq9_org= " + gz + " then tqq9_permonthsales_gz when tqq9_org= " + cd + " then tqq9_permonthsales_cd else 0 end", "tqq9_permonthsales"); -// purorderbillDataSet = purorderbillDataSet.leftJoin(materialpurchaseinfoDataSet).on("tqq9_purordermaterial", "tqq9_purordermaterial").select("tqq9_isauto", "tqq9_org", "tqq9_material", "tqq9_inventory_sh", "tqq9_inventory_bj", "tqq9_inventory_gz", "tqq9_inventory_cd").finish(); -// pendingSet = pendingSet.leftJoin(materialpurchaseinfoDataSet).on("tqq9_purordermaterial", "tqq9_purordermaterial").select("tqq9_isauto", "tqq9_org", "tqq9_material", "tqq9_pendingqty").finish(); materialpackageDataSet = materialpackageDataSet.leftJoin(purorderbillDataSet).on("tqq9_org", "tqq9_org").on("tqq9_purordermaterial", "tqq9_purordermaterial").select("tqq9_material", "tqq9_sku_lc", "tqq9_org", "tqq9_purordermaterial", "tqq9_materialinventoryinfo", "tqq9_onsale_sh", "tqq9_onsale_bj", "tqq9_onsale_gz", "tqq9_purchaser_sh", "tqq9_purchaser_bj", "tqq9_purchaser_gz", "tqq9_shinventory", "tqq9_bjinventory", "tqq9_gzinventory", "tqq9_cdinventory", "tqq9_totalinventory", "tqq9_permonthsales_sh", "tqq9_permonthsales_bj", "tqq9_permonthsales_gz", "tqq9_permonthsales_cd", "tqq9_permonthsales", "tqq9_totalqty_sh", "tqq9_totalqty_bj", "tqq9_totalqty_gz", "tqq9_totalqty_cd", "tqq9_totalqty", "tqq9_inventory_sh", "tqq9_inventory_bj", "tqq9_inventory_gz", "tqq9_inventory_cd", @@ -371,6 +370,7 @@ public class PurSuggestRptFromPlugin extends AbstractFormPlugin implements Plugi } dataEntity.set("tqq9_pursuggestrptentry", entryentity); dataEntity.set("tqq9_queryqty", sizeStr); + SaveServiceHelper.save(new DynamicObject[]{dataEntity}); this.getView().updateView(); } else if (StringUtils.equals("tqq9_purapply", itemKey)) { DynamicObjectCollection tqq9_pursuggestrptentry = dataEntity.getDynamicObjectCollection("tqq9_pursuggestrptentry"); diff --git a/lc123/cloud/app/plugin/form/pm/PurorderEntryIntroPaybillPlugin.java b/lc123/cloud/app/plugin/form/pm/PurorderEntryIntroPaybillPlugin.java index 7ef9093..d271daa 100644 --- a/lc123/cloud/app/plugin/form/pm/PurorderEntryIntroPaybillPlugin.java +++ b/lc123/cloud/app/plugin/form/pm/PurorderEntryIntroPaybillPlugin.java @@ -295,8 +295,12 @@ public class PurorderEntryIntroPaybillPlugin extends AbstractBillPlugIn implemen } String number = org.getString("number"); DynamicObject materialpurchaseinfo = BusinessDataServiceHelper.loadSingle("bd_materialpurchaseinfo", new QFilter[]{new QFilter("masterid", QCP.equals, tqq9_material.getLong("id"))});//物料采购信息 + QFilter f1 = new QFilter("tqq9_mater.number", "=", tqq9_material.getString("number")); + QFilter f5 = new QFilter("tqq9_isauto", "=", true); + DynamicObject goods = BusinessDataServiceHelper.loadSingle("tqq9_goodspackage", new QFilter[]{f1, f5});//商品 BigDecimal tqq9_saledates = entry.getBigDecimal("tqq9_saledates"); model.setValue("material", materialpurchaseinfo, i);//物料 + model.setValue("tqq9_goods", goods, i);//商品 model.setValue("materialname", tqq9_material.getString("name"), i);//物料名称 model.setValue("unit", tqq9_material.getDynamicObject("baseunit"), i);//计量单位 model.setValue("baseunit", tqq9_material.getDynamicObject("baseunit"), i);//基本单位