1.优化项目建立升级版本携带字段

S
This commit is contained in:
weiyunlong 2025-02-27 15:19:17 +08:00
parent 0013a80047
commit 7405ceb954
1 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,37 @@
package shkd.repc.repmd.formplugin;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import java.math.BigDecimal;
import java.util.EventObject;
public class ProjectBbFormPlugin extends AbstractFormPlugin {
@Override
public void afterBindData(EventObject e) {
super.afterBindData(e);
Long lastprojectid = (Long)this.getModel().getValue("lastprojectid");//上版本项目ID修订使用
if (null != lastprojectid ) {
DynamicObject projectbill = BusinessDataServiceHelper.loadSingle(lastprojectid, "repmd_projectbill");
if (null != projectbill) {
BigDecimal qeugDecimalfield5 = (BigDecimal)this.getModel().getValue("qeug_decimalfield5");//改建后可出租面积
if (qeugDecimalfield5 == null || qeugDecimalfield5.compareTo(BigDecimal.ZERO) == 0) {
this.getModel().setValue("qeug_decimalfield5", projectbill.getBigDecimal("qeug_decimalfield5"));
}
String qeugTextfield3 = (String)this.getModel().getValue("qeug_textfield3");//改建后得房率%
if (qeugTextfield3.isEmpty()) {
this.getModel().setValue("qeug_textfield3", projectbill.getString("qeug_textfield3"));
}
// DynamicObjectCollection collection = this.getModel().getDataEntity().getDynamicObjectCollection("attachmentpanel");//附件
// if (collection.isEmpty()) {
//
// }
}
}
}
}