修复采购控制总金额数值没有变化的问题
This commit is contained in:
parent
93efc25cf7
commit
c36b2dab01
|
@ -18,6 +18,7 @@ import kd.bos.entity.datamodel.IDataModel;
|
|||
import kd.bos.exception.KDException;
|
||||
import kd.bos.form.*;
|
||||
import kd.bos.form.container.Tab;
|
||||
import kd.bos.form.container.TabPage;
|
||||
import kd.bos.form.control.Control;
|
||||
import kd.bos.form.control.EntryGrid;
|
||||
import kd.bos.form.control.Toolbar;
|
||||
|
@ -84,39 +85,6 @@ public class DecisionJumpToConPlanPlugin extends AbstractBillPlugIn implements C
|
|||
String operateKey = eventArgs.getOperateKey();
|
||||
if ("changeplan".equals(operateKey)) {
|
||||
IFormView mainView = this.getView().getMainView();
|
||||
IPageCache pageCache = mainView.getPageCache();
|
||||
String tabPageKeys = pageCache.get("_Tab_Items_TabPageKeys");
|
||||
boolean result = false;
|
||||
String key = "";
|
||||
if (!tabPageKeys.isEmpty()) {
|
||||
String[] splits = tabPageKeys.replaceAll("\\[", "").replaceAll("]", "").split(",");
|
||||
for (String split : splits) {
|
||||
if (split.contains("recos")) {
|
||||
key = split.replaceAll("\"", "");
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
FormShowParameter formShowParameter = new FormShowParameter();
|
||||
formShowParameter.setAppId("recos");
|
||||
formShowParameter.getOpenStyle().setShowType(ShowType.NewTabPage);
|
||||
formShowParameter.getOpenStyle().setTargetKey("tabap");
|
||||
formShowParameter.setCustomParam("formId", "recos_conplan");
|
||||
formShowParameter.setCustomParam("appImageUrl", "icons/pc/application/fdc_cbgl_48_48.png");
|
||||
formShowParameter.setCustomParam("appid", "recos");
|
||||
formShowParameter.setFormId("recos_apphome");
|
||||
formShowParameter.setCaption("成本管理");
|
||||
formShowParameter.setPageId("recos" + mainView.getPageId());
|
||||
mainView.showForm(formShowParameter);
|
||||
getView().sendFormAction(mainView);
|
||||
} else {
|
||||
Tab tab = mainView.getControl("tabap");
|
||||
tab.activeTab(key);
|
||||
}
|
||||
|
||||
IDataModel model = this.getModel();
|
||||
DynamicObjectCollection bidSections = model.getEntryEntity("bidsection");// 标段
|
||||
DynamicObjectCollection bottomSections = model.getEntryEntity("bottomsection");// 标底标段
|
||||
|
@ -155,6 +123,7 @@ public class DecisionJumpToConPlanPlugin extends AbstractBillPlugIn implements C
|
|||
}
|
||||
|
||||
if (finalPriceSum.compareTo(controlAmountSum) >= 1) {
|
||||
jumpRECOS();
|
||||
if (project != null) {
|
||||
generateAimAdjustBill(mainView, model.getDataEntity().getLong("id"), project.getString("number"), seq);
|
||||
}
|
||||
|
@ -164,6 +133,39 @@ public class DecisionJumpToConPlanPlugin extends AbstractBillPlugIn implements C
|
|||
}
|
||||
}
|
||||
|
||||
private void jumpRECOS() {
|
||||
IFormView mainView = this.getView().getMainView();
|
||||
Tab tab = mainView.getControl("tabap");
|
||||
|
||||
boolean result = false;
|
||||
String key = "";
|
||||
List<Control> items = tab.getItems();
|
||||
for (Control item : items) {
|
||||
TabPage tabPage = (TabPage) item;
|
||||
if (tabPage.getKey().contains("recos")) {
|
||||
result = true;
|
||||
key= tabPage.getKey();
|
||||
}
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
FormShowParameter formShowParameter = new FormShowParameter();
|
||||
formShowParameter.setAppId("recos");
|
||||
formShowParameter.getOpenStyle().setShowType(ShowType.NewTabPage);
|
||||
formShowParameter.getOpenStyle().setTargetKey("tabap");
|
||||
formShowParameter.setCustomParam("formId", "recos_conplan");
|
||||
formShowParameter.setCustomParam("appImageUrl", "icons/pc/application/fdc_cbgl_48_48.png");
|
||||
formShowParameter.setCustomParam("appid", "recos");
|
||||
formShowParameter.setFormId("recos_apphome");
|
||||
formShowParameter.setCaption("成本管理");
|
||||
formShowParameter.setPageId("recos" + mainView.getPageId());
|
||||
mainView.showForm(formShowParameter);
|
||||
getView().sendFormAction(mainView);
|
||||
} else {
|
||||
tab.activeTab(key);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateAimAdjustBill(IFormView mainView,Long id, String purProjectNum, int seqNum) {
|
||||
String appPageID = "recos" + mainView.getPageId();
|
||||
IFormView appPageView = mainView.getViewNoPlugin(appPageID);
|
||||
|
|
|
@ -70,12 +70,13 @@ public class WriteBackAdjustAmountOpPlugin extends AbstractOperationServicePlugI
|
|||
bottomEntry.set("qeug_planamount", bottomEntry.getBigDecimal("planamount"));
|
||||
bottomEntry.set("qeug_botcontrolamount", bottomEntry.getBigDecimal("botcontrolamount"));
|
||||
|
||||
BigDecimal controlamount = dynamicObject.getBigDecimal("controlamount").add(adjustSumAmt.subtract(bottomEntry.getBigDecimal("botcontrolamount")));
|
||||
|
||||
bottomEntry.set("planamount", adjustSumAmt);
|
||||
bottomEntry.set("botcontrolamount", adjustSumAmt);
|
||||
bottomEntry.set("botctrlamtexceptvat", adjustSumAmt);
|
||||
bottomEntry.set("nottaxplanamount", adjustSumAmt);
|
||||
|
||||
BigDecimal controlamount = dynamicObject.getBigDecimal("controlamount").add(adjustSumAmt.subtract(bottomEntry.getBigDecimal("botcontrolamount")));
|
||||
dynamicObject.set("controlamount", controlamount);
|
||||
dynamicObject.set("exctaxcontrolamount", controlamount);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue