From 120ef7a4ee6562b8a6ad4ed2f43538f511940d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=9A=E8=B1=86=E8=B1=86?= <13356128+sunandmoon60@user.noreply.gitee.com> Date: Tue, 9 Sep 2025 16:38:22 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=B4=A2=E5=8A=A1=E4=B8=AD=E5=8F=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B0=83=E6=95=B4=202.=E5=85=B6=E4=BB=96=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E7=94=B3=E8=AF=B7=E5=8D=95=E7=95=8C=E9=9D=A2=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E8=B0=83=E6=95=B4=203.=E5=95=86=E5=93=81=E6=89=B9?= =?UTF-8?q?=E6=AC=A1=E6=B3=A8=E5=86=8C=E8=AF=81=E7=AE=A1=E7=90=86=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=8A=9F=E8=83=BD=204.=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=BB=BA=E8=AE=AE=E6=8A=A5=E8=A1=A8=E4=B8=8B=E6=8E=A8?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=205.=E5=93=81=E7=89=8C?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E6=97=B6=E5=8F=8D=E5=86=99=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E4=BF=A1=E6=81=AF=E5=88=B0=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E5=93=81=E7=89=8C=E7=9A=84=E7=89=A9=E6=96=99=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AD=A6=E9=87=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/CasPaybillController.java | 6 - lc123/cloud/app/api/utils/ApiResultExt.java | 2 +- lc123/cloud/app/api/utils/HttpClient.java | 4 +- .../form/ap/PayBillFromApiSavePlugin.java | 4 + .../form/im/OtherOutApplyBillPlugin.java | 128 ++++++++++++++++++ .../form/pm/PuroderBillShareRefundPlugin.java | 50 +++++++ .../form/sys/GoodlotManageBillPlugin.java | 111 +++++++++++++-- .../plugin/form/sys/MaterialBillPlugin.java | 2 + .../form/sys/upattAchmentBillPlugin.java | 38 ++++-- .../ap/PurApplySyncSupplierDeductPlugin.java | 6 +- .../im/PurOrderPushReceiptNoticePlugin.java | 2 +- .../operate/pm/PurRptPushPurOrderPlugin.java | 59 ++++++++ .../plugin/operate/sys/BrandUpdatePlugin.java | 63 +++++++++ 13 files changed, 441 insertions(+), 34 deletions(-) create mode 100644 lc123/cloud/app/plugin/form/im/OtherOutApplyBillPlugin.java create mode 100644 lc123/cloud/app/plugin/operate/pm/PurRptPushPurOrderPlugin.java create mode 100644 lc123/cloud/app/plugin/operate/sys/BrandUpdatePlugin.java diff --git a/lc123/cloud/app/api/controller/CasPaybillController.java b/lc123/cloud/app/api/controller/CasPaybillController.java index acdd153..24bc0b1 100644 --- a/lc123/cloud/app/api/controller/CasPaybillController.java +++ b/lc123/cloud/app/api/controller/CasPaybillController.java @@ -84,12 +84,6 @@ public class CasPaybillController { Boolean iserror = true; for (DynamicObject cas_paybill : cas_paybills) { if (billno.equals(cas_paybill.getString("billno"))) { - Date bizdate = dateFormat.parse(dataMap.get("bizdate").toString()); -// cas_paybill.set("bizdate", bizdate); -// cas_paybill.set("openorg.number", dataMap.get("openorg_number")); -// cas_paybill.set("settletype.number", dataMap.get("settletype_number")); -// cas_paybill.set("payeracctbank.number", dataMap.get("bankaccountnumber")); -// cas_paybill.set("tqq9_billstatus", dataMap.get("billstatus")); cas_paybill.set("description", dataMap.get("description")); cas_paybill.set("tqq9_digital_receipt", dataMap.get("tqq9_digital_receipt")); resultBean.setId(cas_paybill.getString("id")); diff --git a/lc123/cloud/app/api/utils/ApiResultExt.java b/lc123/cloud/app/api/utils/ApiResultExt.java index f83d414..c806e16 100644 --- a/lc123/cloud/app/api/utils/ApiResultExt.java +++ b/lc123/cloud/app/api/utils/ApiResultExt.java @@ -174,10 +174,10 @@ public class ApiResultExt implements Serializable { Set idSet = new HashSet<>(); for (ResultBean resultBean : resultBeans) { Error error = resultBean.getErrors(); - resultBean.setBillStatus(false); String message = iOperateInfo.getMessage(); String id = iOperateInfo.getPkValue().toString(); if (StringUtils.equals(resultBean.getId(),id)) { + resultBean.setBillStatus(false); if (error == null) { error = new Error(); error.setRowMsg(new ArrayList()); diff --git a/lc123/cloud/app/api/utils/HttpClient.java b/lc123/cloud/app/api/utils/HttpClient.java index a6c6456..40bb814 100644 --- a/lc123/cloud/app/api/utils/HttpClient.java +++ b/lc123/cloud/app/api/utils/HttpClient.java @@ -31,10 +31,10 @@ public class HttpClient { new QFilter[]{new QFilter("number", QCP.equals, "FinanceHub_Token_Url")}); DynamicObject userName = BusinessDataServiceHelper.loadSingle("tqq9_thirdconfig", "name", new QFilter[]{new QFilter("number", QCP.equals, "FinanceHub_Token_Username ")}); - USERNAME = userName != null ? userName.getString("rbkj_value") : null; + USERNAME = userName != null ? userName.getString("name") : null; DynamicObject passWord = BusinessDataServiceHelper.loadSingle("tqq9_thirdconfig", "name", new QFilter[]{new QFilter("number", QCP.equals, "FinanceHub_Token_Password")}); - PASSWORD = passWord != null ? passWord.getString("rbkj_value") : null; + PASSWORD = passWord != null ? passWord.getString("name") : null; } private static RestTemplate restTemplate = new RestTemplate(); diff --git a/lc123/cloud/app/plugin/form/ap/PayBillFromApiSavePlugin.java b/lc123/cloud/app/plugin/form/ap/PayBillFromApiSavePlugin.java index f907bab..7e611d4 100644 --- a/lc123/cloud/app/plugin/form/ap/PayBillFromApiSavePlugin.java +++ b/lc123/cloud/app/plugin/form/ap/PayBillFromApiSavePlugin.java @@ -5,6 +5,9 @@ import kd.bos.dataentity.entity.DynamicObject; import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.PreparePropertysEventArgs; import kd.bos.entity.plugin.args.BeforeOperationArgs; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.sdk.plugin.Plugin; /** @@ -41,6 +44,7 @@ public class PayBillFromApiSavePlugin extends AbstractOperationServicePlugIn imp bill.set("recaccbankname", payeeName); } DynamicObject payeeBank = bill.getDynamicObject("payeebank");//收款银行 + payeeBank = BusinessDataServiceHelper.loadSingle("bd_bebank", new QFilter[]{new QFilter("number", QCP.equals, payeeBank.getString("number"))}); String recBankNumber = bill.getString("recbanknumber");//收款行号 if(payeeBank != null && StringUtils.isBlank(recBankNumber)){ bill.set("recbanknumber", payeeBank.getString("number")); diff --git a/lc123/cloud/app/plugin/form/im/OtherOutApplyBillPlugin.java b/lc123/cloud/app/plugin/form/im/OtherOutApplyBillPlugin.java new file mode 100644 index 0000000..e59e673 --- /dev/null +++ b/lc123/cloud/app/plugin/form/im/OtherOutApplyBillPlugin.java @@ -0,0 +1,128 @@ +package tqq9.lc123.cloud.app.plugin.form.im; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.bill.BillShowParameter; +import kd.bos.bill.OperationStatus; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.utils.StringUtils; +import kd.bos.entity.datamodel.IDataModel; +import kd.bos.entity.datamodel.ListSelectedRow; +import kd.bos.entity.datamodel.ListSelectedRowCollection; +import kd.bos.entity.datamodel.events.ChangeData; +import kd.bos.entity.datamodel.events.PropertyChangedArgs; +import kd.bos.form.IFormView; +import kd.bos.form.ShowType; +import kd.bos.form.StyleCss; +import kd.bos.form.control.Control; +import kd.bos.form.events.ClosedCallBackEvent; +import kd.bos.form.events.HyperLinkClickEvent; +import kd.bos.form.events.HyperLinkClickListener; +import kd.bos.form.field.BasedataEdit; +import kd.bos.form.field.events.BeforeF7SelectEvent; +import kd.bos.form.field.events.BeforeF7SelectListener; +import kd.bos.list.ListShowParameter; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; + +import java.util.EventObject; + +/** + * 其他出库申请界面插件 + */ +public class OtherOutApplyBillPlugin extends AbstractBillPlugIn implements BeforeF7SelectListener { + @Override + public void registerListener(EventObject e) { + super.registerListener(e); + this.addItemClickListeners("tbmain"); + BasedataEdit control = this.getControl("tqq9_lot"); + control.addBeforeF7SelectListener(this); + this.addClickListeners("tqq9_xsddh"); + + + } + + /**出库批号根据了做筛选 + * + */ + + @Override + public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) { + int index = this.getModel().getEntryCurrentRowIndex("entryentity"); + DynamicObjectCollection entryentity = this.getModel().getDataEntity(true).getDynamicObjectCollection("entryentity"); + DynamicObject dynamicObject = entryentity.get(index); + DynamicObject tqq9_materiel = dynamicObject.getDynamicObject("tqq9_materiel"); + if (tqq9_materiel == null) { + beforeF7SelectEvent.setCancel(true); + this.getView().showMessage("请先填物料信息"); + } else { + DynamicObject materiel = tqq9_materiel.getDynamicObject("masterid");//物料 + Boolean enablelot = tqq9_materiel.getBoolean("enablelot");//是否启用批号管理 + if (enablelot) { + ListShowParameter param = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter(); + QFilter qF1 = new QFilter("material.number", QCP.equals, materiel.getString("number")); + param.getListFilterParameter().getQFilters().add(qF1); + } else { + beforeF7SelectEvent.setCancel(true); + this.getView().showMessage("该物料未启用批号管理"); + } + + } + } + /**售后单号带出售后信息 + * + */ + + @Override + public void propertyChanged(PropertyChangedArgs e) { + super.propertyChanged(e); + String name = e.getProperty().getName(); + IDataModel model = this.getModel(); + if (StringUtils.equals("tqq9_returnapply", name)) { + ChangeData[] changeSet = e.getChangeSet(); + DynamicObject newValue = (DynamicObject) changeSet[0].getNewValue();//销售退货申请单 + DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle("sm_returnapply", new QFilter[]{new QFilter("billno", QCP.equals, newValue.getString("billno"))}); + DynamicObjectCollection billentry = dynamicObject.getDynamicObjectCollection("billentry"); + if (billentry.size() > 0) { + DynamicObject entry = billentry.get(0); + String mainbillnumber = entry.getString("mainbillnumber");//核心单据编号 + String tqq9_kddh = dynamicObject.getString("tqq9_kddh");//快递单号 + DynamicObject tqq9_sskf = dynamicObject.getDynamicObject("tqq9_sskf");//所属客服 + DynamicObject operator = dynamicObject.getDynamicObject("operator");//所属客服 + DynamicObject customer = dynamicObject.getDynamicObject("customer");//订货客户 + model.setValue("tqq9_xsddh", mainbillnumber);//对应销售订单号 + model.setValue("tqq9_dpdh", tqq9_kddh);//DP单号 + model.setValue("tqq9_sskf", tqq9_sskf);//所属客服 + model.setValue("tqq9_ssxs", operator);//所属销售 + model.setValue("tqq9_kufptt", customer);//客户发票抬头 + } + + + } + } + + /**点击对应销售订单号跳转 + * + */ + @Override + public void click(EventObject evt) { + super.click(evt); + Control source = (Control) evt.getSource(); + if (StringUtils.equals("tqq9_xsddh", source.getKey())) { + String tqq9_xsddh = (String) this.getModel().getValue("tqq9_xsddh"); + DynamicObject sm_salorder = BusinessDataServiceHelper.loadSingle("sm_salorder", new QFilter[]{new QFilter("billno", QCP.equals, tqq9_xsddh)}); + Long id = sm_salorder.getLong("id"); + if (id != null) { + BillShowParameter formshowParameter = new BillShowParameter(); + formshowParameter.setFormId("sm_salorder"); + formshowParameter.getOpenStyle().setInlineStyleCss(new StyleCss()); + formshowParameter.setPkId(id); + formshowParameter.getOpenStyle().setShowType(ShowType.Modal); + formshowParameter.setStatus(OperationStatus.VIEW); + this.getView().showForm(formshowParameter); + } + } + + } +} \ No newline at end of file diff --git a/lc123/cloud/app/plugin/form/pm/PuroderBillShareRefundPlugin.java b/lc123/cloud/app/plugin/form/pm/PuroderBillShareRefundPlugin.java index 1936891..15817a0 100644 --- a/lc123/cloud/app/plugin/form/pm/PuroderBillShareRefundPlugin.java +++ b/lc123/cloud/app/plugin/form/pm/PuroderBillShareRefundPlugin.java @@ -1,5 +1,7 @@ package tqq9.lc123.cloud.app.plugin.form.pm; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import kd.bos.bill.AbstractBillPlugIn; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; @@ -11,11 +13,17 @@ import kd.bos.entity.datamodel.events.ChangeData; import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.logging.Log; import kd.bos.logging.LogFactory; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; +import org.springframework.http.ResponseEntity; +import tqq9.lc123.cloud.app.api.utils.HttpClient; import java.math.BigDecimal; import java.math.RoundingMode; +import java.net.ConnectException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; /** @@ -26,6 +34,12 @@ public class PuroderBillShareRefundPlugin extends AbstractBillPlugIn { private final static Log logger = LogFactory.getLog(PuroderBillShareRefundPlugin.class); private final static String ENTRYENTITY = "billentry"; + private static String URL; + static { + DynamicObject url = BusinessDataServiceHelper.loadSingle("tqq9_thirdconfig", "name", + new QFilter[]{new QFilter("number", QCP.equals, "FLXT_Balance_Url")}); + URL = url != null ? url.getString("name") : null; + } @Override @@ -310,5 +324,41 @@ public class PuroderBillShareRefundPlugin extends AbstractBillPlugIn { } +// if (StringUtils.equals("supplier", name)) { +// IDataModel model = this.getModel(); +// ChangeData changeData = e.getChangeSet()[0]; +// DynamicObject newValue = (DynamicObject) changeData.getNewValue();//供应商 +// DynamicObject org = (DynamicObject)model.getValue("org");//组织 +// HashMap queryMap =new HashMap<>(); +// queryMap.put("supplierId",newValue.getString("number")); +//// queryMap.put("supplierId","1024"); +// queryMap.put("companyId",org.getString("number")); +// try { +// ResponseEntity responseEntity = HttpClient.doPost(URL, null, "Authorization", "Bearer b96dad1eb4f84c41bae651162aeacdd3", queryMap); +// JSONObject responseEntityBody = (JSONObject)responseEntity.getBody(); +// JSONArray data = responseEntityBody.getJSONArray("data"); +// for (Object datum : data) { +// JSONObject datum1 = (JSONObject) datum; +// String type = datum1.get("type").toString();//类型 +// if(StringUtils.equals(type,"0")){ +// //货返 +// BigDecimal totalMoney = (BigDecimal) datum1.get("totalMoney");//剩余总金额 +// BigDecimal totalMoneyAvailable = (BigDecimal) datum1.get("totalMoneyAvailable");//可使用金额 +// model.setValue("tqq9_hshfzje",totalMoney);//含税货返总金额 +// model.setValue("tqq9_hshfkyje",totalMoneyAvailable);//含税货返可用金额 +// }else if(StringUtils.equals(type,"1")){ +// BigDecimal totalMoney = (BigDecimal) datum1.get("totalMoney");//剩余总金额 +// BigDecimal totalMoneyAvailable = (BigDecimal) datum1.get("totalMoneyAvailable");//可使用金额 +// model.setValue("tqq9_hsxfzje",totalMoney);//含税现返总金额 +// model.setValue("tqq9_hsxfzje",totalMoneyAvailable);//含税现返可用金额 +// } +// } +// getView().updateView(); +// } catch (ConnectException ex) { +// throw new RuntimeException(ex); +// } +// +// +// } } } diff --git a/lc123/cloud/app/plugin/form/sys/GoodlotManageBillPlugin.java b/lc123/cloud/app/plugin/form/sys/GoodlotManageBillPlugin.java index 1326462..beb2589 100644 --- a/lc123/cloud/app/plugin/form/sys/GoodlotManageBillPlugin.java +++ b/lc123/cloud/app/plugin/form/sys/GoodlotManageBillPlugin.java @@ -1,16 +1,28 @@ package tqq9.lc123.cloud.app.plugin.form.sys; -import kd.bos.bill.AbstractBillPlugIn; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.utils.StringUtils; +import kd.bos.entity.datamodel.ListSelectedRowCollection; import kd.bos.form.CloseCallBack; import kd.bos.form.FormShowParameter; import kd.bos.form.ShowType; +import kd.bos.form.control.events.BeforeItemClickEvent; import kd.bos.form.control.events.ItemClickEvent; import kd.bos.form.events.ClosedCallBackEvent; +import kd.bos.form.events.HyperLinkClickArgs; +import kd.bos.list.BillList; +import kd.bos.list.IListView; import kd.bos.list.plugin.AbstractListPlugin; +import kd.bos.logging.Log; +import kd.bos.logging.LogFactory; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.sdk.plugin.Plugin; +import java.util.ArrayList; +import java.util.Date; import java.util.EventObject; import java.util.HashMap; @@ -18,40 +30,117 @@ import java.util.HashMap; * 商品批次注册证管理界面插件 */ public class GoodlotManageBillPlugin extends AbstractListPlugin implements Plugin { + private final static Log logger = LogFactory.getLog(GoodlotManageBillPlugin.class); + + /** + * 控件监听 + */ @Override public void registerListener(EventObject e) { super.registerListener(e); this.addItemClickListeners("tbmain"); + this.addClickListeners("tqq9_lotcheck", "tqq9_customcheck"); + } + /** + * 点击前事件,校验是否选择单行数据 + */ + @Override + public void beforeItemClick(BeforeItemClickEvent evt) { + super.beforeItemClick(evt); + String itemKey = evt.getItemKey(); + + if (StringUtils.equals(itemKey, "tqq9_lotchecktb") || StringUtils.equals(itemKey, "tqq9_customchecktb")) { + BillList billList = (BillList) this.getControl("billlistap"); + ListSelectedRowCollection selectedRows = billList.getSelectedRows(); + if (selectedRows.size() > 1) { + evt.setCancel(true); + this.getView().showMessage("请选择单行信息"); + } else if (selectedRows.size() == 0) { + evt.setCancel(true); + this.getView().showMessage("请选择要执的单行信息"); + } + } + + } + + /** + * 点击跳转附件上传页面 + */ @Override public void itemClick(ItemClickEvent evt) { super.itemClick(evt); String itemKey = evt.getItemKey(); - if (StringUtils.equals(itemKey,"tqq9_lotchecktb")||StringUtils.equals(itemKey,"tqq9_customchecktb")) { + if (StringUtils.equals(itemKey, "tqq9_lotchecktb") || StringUtils.equals(itemKey, "tqq9_customchecktb")) { + BillList billList = (BillList) this.getControl("billlistap"); + ListSelectedRowCollection selectedRows = billList.getSelectedRows(); + Object[] ids = selectedRows.getPrimaryKeyValues(); + Object id = ids[0]; FormShowParameter param = new FormShowParameter(); - param.setFormId("tqq9_upattachment"); - param.setCloseCallBack(new CloseCallBack(this, "tqq9_upattachment")); + param.setFormId("tqq9_upload"); + param.setCloseCallBack(new CloseCallBack(this, "tqq9_upload")); param.getOpenStyle().setShowType(ShowType.Modal); + param.setCustomParam("buttontype", itemKey); + param.setCustomParam("id", id); this.getView().showForm(param); } } + /** + * 附件上传页面回传附件信息 + */ @Override public void closedCallBack(ClosedCallBackEvent closedCallBackEvent) { super.closedCallBack(closedCallBackEvent); String actionId = closedCallBackEvent.getActionId(); Object returnData = closedCallBackEvent.getReturnData(); if (returnData != null) { - if ("tqq9_upattachment".equals(actionId)) { - - DynamicObject data = (DynamicObject) ((HashMap) returnData).get("data"); -// model.setValue("tqq9_paybillno", dynamicObject.getString("billno"));//付款单 -// model.setValue("joinpayamount", unsettleamount, seq);//关联付款金额 -// model.setValue("paidamount", unsettleamount, seq);//已付金额 -// model.setValue("tqq9_settleamount", unsettleamount, seq);//本次结算金额 + if (StringUtils.equals("tqq9_upload", actionId)) { + ArrayList attachmentData = (ArrayList) ((HashMap) returnData).get("attachmentData"); + HashMap map = (HashMap) attachmentData.get(0); + String url = map.get("url").toString(); + HashMap creator = (HashMap) map.get("creator"); + String name = creator.get("zh_CN").toString(); + DynamicObject user = BusinessDataServiceHelper.loadSingle("bos_user", new QFilter[]{new QFilter("name", QCP.equals, name)}); + Long uploadTime = (Long) map.get("uploadTime"); + Date date = new Date(uploadTime); + String buttontype = ((HashMap) returnData).get("buttontype").toString(); + Object id = ((HashMap) returnData).get("id"); + DynamicObject tqq9_goodlotmanage = BusinessDataServiceHelper.loadSingle(id, "tqq9_goodlotmanage"); + if (StringUtils.equals("tqq9_lotchecktb", buttontype)) { + tqq9_goodlotmanage.set("tqq9_lotcheck", url);//中台批次检测文件 + tqq9_goodlotmanage.set("tqq9_lotcheckdate", date);//批次检测报告操作时间 + tqq9_goodlotmanage.set("tqq9_lotcheckperson", user);//批次检测报表操作人 + SaveServiceHelper.save(new DynamicObject[]{tqq9_goodlotmanage}); + } else if (StringUtils.equals("tqq9_customchecktb", buttontype)) { + tqq9_goodlotmanage.set("tqq9_customcheck", url);//中台报关单文件 + tqq9_goodlotmanage.set("tqq9_customcheckdate", date);//报关单操作时间 + tqq9_goodlotmanage.set("tqq9_customcheckperson", user);//报关单操作人 + SaveServiceHelper.save(new DynamicObject[]{tqq9_goodlotmanage}); + } getView().updateView(); } } } + + /** + * 点击链接下载 + */ + @Override + public void billListHyperLinkClick(HyperLinkClickArgs args) { + super.billListHyperLinkClick(args); + String fieldName = args.getFieldName(); + args.setCancel(true); + if (StringUtils.equals("tqq9_lotcheck", fieldName) || StringUtils.equals("tqq9_customcheck", fieldName)) { + ListSelectedRowCollection selectedRows = ((IListView) this.getView()).getSelectedRows(); + Object id = selectedRows.getPrimaryKeyValues()[0]; + DynamicObject tqq9_goodlotmanage = BusinessDataServiceHelper.loadSingle(id, "tqq9_goodlotmanage"); + String url = tqq9_goodlotmanage.getString(fieldName); + if (url != null) { + this.getView().download(url); + } + } + } + } \ No newline at end of file diff --git a/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java b/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java index b26d2c3..df2660e 100644 --- a/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java +++ b/lc123/cloud/app/plugin/form/sys/MaterialBillPlugin.java @@ -49,4 +49,6 @@ public class MaterialBillPlugin extends AbstractBillPlugIn { // this.getView().setVisible(true, "tqq9_bgyy","tqq9_bgyy2","tqq9_shbgyy","tqq9_bgms1","tqq9_bgms2","tqq9_bgms3"); } } + + } diff --git a/lc123/cloud/app/plugin/form/sys/upattAchmentBillPlugin.java b/lc123/cloud/app/plugin/form/sys/upattAchmentBillPlugin.java index d9442d1..8051780 100644 --- a/lc123/cloud/app/plugin/form/sys/upattAchmentBillPlugin.java +++ b/lc123/cloud/app/plugin/form/sys/upattAchmentBillPlugin.java @@ -1,11 +1,16 @@ package tqq9.lc123.cloud.app.plugin.form.sys; import kd.bos.bill.AbstractBillPlugIn; -import kd.bos.form.control.Control; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.utils.StringUtils; +import kd.bos.form.FormShowParameter; +import kd.bos.form.control.AttachmentPanel; +import kd.bos.form.events.AfterDoOperationEventArgs; import kd.sdk.plugin.Plugin; import java.util.EventObject; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -16,22 +21,33 @@ public class upattAchmentBillPlugin extends AbstractBillPlugIn implements Plugin @Override public void registerListener(EventObject e) { super.registerListener(e); - this.addClickListeners("btnok"); + this.addItemClickListeners("tqq9_toolbarap"); } + /** + * 由商品批次注册证管理界面跳转此界面,选择附件后回传相关信息 + */ @Override - public void click(EventObject evt) { - super.click(evt); - Control control = (Control) evt.getSource(); - if ("btnok".equals(control.getKey())) { - Map data = new HashMap<>(); - data.put("tqq9_attachmentpanelap", this.getModel().getValue("tqq9_attachmentpanelap")); -// data.put("query_project", this.getModel().getValue("rbkj_project")); -// data.put("isContinue", true); - this.getView().returnDataToParent(data); + public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) { + super.afterDoOperation(afterDoOperationEventArgs); + String itemKey = afterDoOperationEventArgs.getOperateKey(); + if (StringUtils.equals("donothing", itemKey)) { + FormShowParameter formShowParameter = this.getView().getFormShowParameter(); + String buttontype = formShowParameter.getCustomParam("buttontype").toString(); + String id = formShowParameter.getCustomParam("id").toString(); + AttachmentPanel tqq9_attachmentpanelap = this.getView().getControl("tqq9_attachmentpanelap"); + List> attachmentData = tqq9_attachmentpanelap.getAttachmentData(); + HashMap map = new HashMap<>(); + map.put("attachmentData", attachmentData); + map.put("buttontype", buttontype); + map.put("id", id); + this.getView().returnDataToParent(map); this.getView().close(); + } } + + } \ No newline at end of file diff --git a/lc123/cloud/app/plugin/operate/ap/PurApplySyncSupplierDeductPlugin.java b/lc123/cloud/app/plugin/operate/ap/PurApplySyncSupplierDeductPlugin.java index e665953..1436b57 100644 --- a/lc123/cloud/app/plugin/operate/ap/PurApplySyncSupplierDeductPlugin.java +++ b/lc123/cloud/app/plugin/operate/ap/PurApplySyncSupplierDeductPlugin.java @@ -19,18 +19,20 @@ import java.math.BigDecimal; import java.util.Map; /** - * 单据转换插件 + * 付款申请单转换规则插件 */ public class PurApplySyncSupplierDeductPlugin extends AbstractConvertPlugIn implements Plugin { private final static Log logger = LogFactory.getLog(PurApplySyncSupplierDeductPlugin.class); private static String RECEIPTNOTICE = "ap_payapply"; + /** + * 付款申请单反写供应商可抵扣总额 + */ @Override public void afterConvert(AfterConvertEventArgs e) { super.afterConvert(e); ExtendedDataEntitySet targetExtDataEntitySet = e.getTargetExtDataEntitySet(); ExtendedDataEntity[] extendedDataEntities = targetExtDataEntitySet.FindByEntityKey(RECEIPTNOTICE); -// Map variables = this.getOption().getVariables(); for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) { //付款申请单 DynamicObject dataEntity = extendedDataEntity.getDataEntity(); diff --git a/lc123/cloud/app/plugin/operate/im/PurOrderPushReceiptNoticePlugin.java b/lc123/cloud/app/plugin/operate/im/PurOrderPushReceiptNoticePlugin.java index 7ea7895..04394e1 100644 --- a/lc123/cloud/app/plugin/operate/im/PurOrderPushReceiptNoticePlugin.java +++ b/lc123/cloud/app/plugin/operate/im/PurOrderPushReceiptNoticePlugin.java @@ -14,7 +14,7 @@ import java.math.BigDecimal; import java.util.Map; /** - * 采购订单转换插件 + * 采购订单下推收获通知单转换插件 * 退货补货数量修改 */ public class PurOrderPushReceiptNoticePlugin extends AbstractConvertPlugIn implements Plugin { diff --git a/lc123/cloud/app/plugin/operate/pm/PurRptPushPurOrderPlugin.java b/lc123/cloud/app/plugin/operate/pm/PurRptPushPurOrderPlugin.java new file mode 100644 index 0000000..908929d --- /dev/null +++ b/lc123/cloud/app/plugin/operate/pm/PurRptPushPurOrderPlugin.java @@ -0,0 +1,59 @@ +package tqq9.lc123.cloud.app.plugin.operate.pm; + +import com.oracle.truffle.regex.tregex.string.StringUTF16; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.utils.StringUtils; +import kd.bos.entity.ExtendedDataEntity; +import kd.bos.entity.ExtendedDataEntitySet; +import kd.bos.entity.botp.plugin.AbstractConvertPlugIn; +import kd.bos.entity.botp.plugin.args.AfterConvertEventArgs; +import kd.bos.logging.Log; +import kd.bos.logging.LogFactory; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.sdk.plugin.Plugin; +import tqq9.lc123.cloud.app.plugin.operate.im.PurOrderPushReceiptNoticePlugin; + +import java.math.BigDecimal; +import java.util.Map; + +/** + * 采购订单下推采购建议报表转换插件 + */ +public class PurRptPushPurOrderPlugin extends AbstractConvertPlugIn implements Plugin { + private final static Log logger = LogFactory.getLog(PurRptPushPurOrderPlugin.class); + private static String PURORDERBILL = "pm_purorderbill";//采购订单 + + @Override + public void afterConvert(AfterConvertEventArgs e) { + super.afterConvert(e); + ExtendedDataEntitySet targetExtDataEntitySet = e.getTargetExtDataEntitySet(); + ExtendedDataEntity[] extendedDataEntities = targetExtDataEntitySet.FindByEntityKey(PURORDERBILL); + Map variables = this.getOption().getVariables(); + for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) { + //采购订单 + DynamicObject dataEntity = extendedDataEntity.getDataEntity(); + DynamicObjectCollection dynamicObjectCollection = dataEntity.getDynamicObjectCollection("billentry"); + for (DynamicObject dynamicObject : dynamicObjectCollection) { + DynamicObject org = dataEntity.getDynamicObject("org");//采购组织 + String number = org.getString("number"); + DynamicObject materialpurchaseinfo = dynamicObject.getDynamicObject("material");//物料采购信息 + DynamicObject masterid = materialpurchaseinfo.getDynamicObject("masterid");//物料信息 + masterid = BusinessDataServiceHelper.loadSingle("bd_material", new QFilter[]{new QFilter("number", QCP.equals, masterid.getString("number"))}); + BigDecimal maxprice = BigDecimal.ZERO; + if(StringUtils.equals("SHLC",number)){ + maxprice=masterid.getBigDecimal("tqq9_maxprice_sh"); + }else if(StringUtils.equals("BJLC",number)){ + maxprice=masterid.getBigDecimal("tqq9_maxprice_bj"); + }else if(StringUtils.equals("GZLC",number)){ + maxprice=masterid.getBigDecimal("tqq9_maxprice_gz"); + } + dynamicObject.set("priceandtax",maxprice); + dynamicObject.set("tqq9_zgcgxj",maxprice); + } + } + + } +} \ No newline at end of file diff --git a/lc123/cloud/app/plugin/operate/sys/BrandUpdatePlugin.java b/lc123/cloud/app/plugin/operate/sys/BrandUpdatePlugin.java new file mode 100644 index 0000000..1ff6da8 --- /dev/null +++ b/lc123/cloud/app/plugin/operate/sys/BrandUpdatePlugin.java @@ -0,0 +1,63 @@ +package tqq9.lc123.cloud.app.plugin.operate.sys; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.plugin.AbstractOperationServicePlugIn; +import kd.bos.entity.plugin.args.AfterOperationArgs; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; +import kd.sdk.plugin.Plugin; + +import java.util.ArrayList; +import java.util.UUID; + +/** + * 品牌审核时反写执行采购信息到对应品牌的物料信息学里 + */ +public class BrandUpdatePlugin extends AbstractOperationServicePlugIn implements Plugin { + + @Override + public void afterExecuteOperationTransaction(AfterOperationArgs e) { + super.afterExecuteOperationTransaction(e); + for (DynamicObject dataEntity : e.getDataEntities()) { + String number = dataEntity.getString("number"); + DynamicObject tqq9_brand = BusinessDataServiceHelper.loadSingle("tqq9_brand", "id,name,number,tqq9_shcg,tqq9_bjcg,tqq9_gzcg",new QFilter[]{new QFilter("number", QCP.equals, number)}); + DynamicObjectCollection tqq9_shcg = tqq9_brand.getDynamicObjectCollection("tqq9_shcg"); + DynamicObjectCollection tqq9_bjcg = tqq9_brand.getDynamicObjectCollection("tqq9_bjcg"); + DynamicObjectCollection tqq9_gzcg = tqq9_brand.getDynamicObjectCollection("tqq9_gzcg"); + DynamicObject[] bd_material = BusinessDataServiceHelper.load("bd_material", "id,name,number,tqq9_shcg,tqq9_bjcg,tqq9_gzcg", new QFilter[]{new QFilter("tqq9_brand.number", QCP.equals, number)}); + for (DynamicObject dynamicObject : bd_material) { + DynamicObjectCollection tqq9_shcg1 = dynamicObject.getDynamicObjectCollection("tqq9_shcg"); + tqq9_shcg1.clear(); + for (int i = 0; i < tqq9_shcg.size(); i++) { + DynamicObject shcg = tqq9_shcg.get(i); + DynamicObject newbrand = new DynamicObject(tqq9_shcg1.getDynamicObjectType()); + newbrand.set("fbasedataid",shcg.getDynamicObject("fbasedataid")); + tqq9_shcg1.add(newbrand); + } + DynamicObjectCollection tqq9_bjcg1 = dynamicObject.getDynamicObjectCollection("tqq9_bjcg"); + tqq9_bjcg1.clear(); + for (int i = 0; i < tqq9_bjcg.size(); i++) { + DynamicObject bjcg = tqq9_bjcg.get(i); + DynamicObject newbrand = new DynamicObject(tqq9_bjcg1.getDynamicObjectType()); + newbrand.set("fbasedataid",bjcg.getDynamicObject("fbasedataid")); + tqq9_bjcg1.add(newbrand); + } + DynamicObjectCollection tqq9_gzcg1 = dynamicObject.getDynamicObjectCollection("tqq9_gzcg"); + tqq9_gzcg1.clear(); + for (int i = 0; i < tqq9_gzcg.size(); i++) { + DynamicObject gzcg = tqq9_gzcg.get(i); + DynamicObject newbrand = new DynamicObject(tqq9_gzcg1.getDynamicObjectType()); + newbrand.set("fbasedataid",gzcg.getDynamicObject("fbasedataid")); + tqq9_gzcg1.add(newbrand); + } + dynamicObject.set("tqq9_shcg",tqq9_shcg1); + dynamicObject.set("tqq9_bjcg",tqq9_bjcg1); + dynamicObject.set("tqq9_gzcg",tqq9_gzcg1); + } + SaveServiceHelper.save(bd_material); + } + } +} \ No newline at end of file