diff --git a/main/java/shkd/repc/recos/formplugin/CreatTargetCostFormPlugin.java b/main/java/shkd/repc/recos/formplugin/CreatTargetCostFormPlugin.java index 5406c57..ac56d66 100644 --- a/main/java/shkd/repc/recos/formplugin/CreatTargetCostFormPlugin.java +++ b/main/java/shkd/repc/recos/formplugin/CreatTargetCostFormPlugin.java @@ -33,16 +33,20 @@ public class CreatTargetCostFormPlugin extends AbstractBillPlugIn implements Plu DynamicObject dynamicObject = this.getModel().getDataEntity(); Object primaryKeyValue = dynamicObject.getPkValue(); if ("qeug_creat".equals(evt.getItemKey())) { - QFilter measurecostid = new QFilter("measurecostid", QCP.equals, primaryKeyValue); + QFilter measurecostid = new QFilter("project", QCP.equals, dynamicObject.getDynamicObject("project").getPkValue()); DynamicObject dynamicObject2 = BusinessDataServiceHelper.loadSingle("recos_aimcost", measurecostid.toArray()); if (dynamicObject2!=null) { this.getView().showMessage("存在对应目标成本,无法生成"); return; } - dynamicObject.set("aimversionflag",true); + dynamicObject.set("qeug_aimversionflag",true); SaveServiceHelper.update(dynamicObject); AimCostGenByMeasureHelper.generateAimCost((Long)dynamicObject.getPkValue()); - this.getView().updateView("aimversionflag"); + OperationResult unAuditOpResult = AimCostGenByMeasureHelper.unAuditAimCost(dynamicObject.getPkValue()); + if (null != unAuditOpResult && !unAuditOpResult.isSuccess()) { + this.getView().showMessage(((IOperateInfo)unAuditOpResult.getAllErrorOrValidateInfo().get(0)).getMessage()); + } + this.getView().updateView("qeug_aimversionflag"); this.getView().showSuccessNotification("生成成功"); }else if("qeug_revoked".equals(evt.getItemKey())){ boolean aimversionflag = dynamicObject.getBoolean("aimversionflag");