成本测算:手工生成目标成本添加判断
This commit is contained in:
parent
acc73a5e07
commit
7a86773aba
|
@ -33,16 +33,20 @@ public class CreatTargetCostFormPlugin extends AbstractBillPlugIn implements Plu
|
||||||
DynamicObject dynamicObject = this.getModel().getDataEntity();
|
DynamicObject dynamicObject = this.getModel().getDataEntity();
|
||||||
Object primaryKeyValue = dynamicObject.getPkValue();
|
Object primaryKeyValue = dynamicObject.getPkValue();
|
||||||
if ("qeug_creat".equals(evt.getItemKey())) {
|
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());
|
DynamicObject dynamicObject2 = BusinessDataServiceHelper.loadSingle("recos_aimcost", measurecostid.toArray());
|
||||||
if (dynamicObject2!=null) {
|
if (dynamicObject2!=null) {
|
||||||
this.getView().showMessage("存在对应目标成本,无法生成");
|
this.getView().showMessage("存在对应目标成本,无法生成");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dynamicObject.set("aimversionflag",true);
|
dynamicObject.set("qeug_aimversionflag",true);
|
||||||
SaveServiceHelper.update(dynamicObject);
|
SaveServiceHelper.update(dynamicObject);
|
||||||
AimCostGenByMeasureHelper.generateAimCost((Long)dynamicObject.getPkValue());
|
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("生成成功");
|
this.getView().showSuccessNotification("生成成功");
|
||||||
}else if("qeug_revoked".equals(evt.getItemKey())){
|
}else if("qeug_revoked".equals(evt.getItemKey())){
|
||||||
boolean aimversionflag = dynamicObject.getBoolean("aimversionflag");
|
boolean aimversionflag = dynamicObject.getBoolean("aimversionflag");
|
||||||
|
|
Loading…
Reference in New Issue