1.采购全流程携带(供方入围,标书编制,标底编制,招标交底,发标开标,答疑记录,评标谈判,定标)

2.立项提交时控制,立项控制金额不能大于采购计划的源单控制金额+申请单明细合并后申请金额+合约规划中规划金额
3.采购需求代码调用编码规则
4.优化需求,计划,立项,根据组织携带项目的逻辑(缺省值:虚拟项目)

S
This commit is contained in:
weiyunlong 2024-12-17 12:39:25 +08:00
parent df26e7a0c0
commit d0f4cc31d2
5 changed files with 136 additions and 93 deletions

View File

@ -72,12 +72,17 @@ public class ImportPurchaseApplyBillPlugin extends AbstractBillPlugIn implements
//采购项目 //采购项目
DynamicObject[] projectbills = BusinessDataServiceHelper.load("rebm_purproject", "id", DynamicObject[] projectbills = BusinessDataServiceHelper.load("rebm_purproject", "id",
new QFilter[]{new QFilter("org.id", QCP.equals, org.getPkValue())}); new QFilter[]{new QFilter("org.id", QCP.equals, org.getPkValue())});
DynamicObject projectbill = null;
if (projectbills.length > 0) { if (projectbills.length > 0) {
DynamicObject projectbill = projectbills[0]; projectbill = projectbills[0];
}else {
DynamicObject[] projectbillss = BusinessDataServiceHelper.load("rebm_purproject", "id",
new QFilter[]{new QFilter("number", QCP.equals, "XM-202412-008")});
projectbill = projectbillss[0];
}
this.getModel().setValue("qeug_renovation_proj", projectbill); this.getModel().setValue("qeug_renovation_proj", projectbill);
this.getView().updateView("qeug_renovation_proj"); this.getView().updateView("qeug_renovation_proj");
} }
}

View File

@ -1,11 +1,17 @@
package shkd.repc.rebm.formplugin; package shkd.repc.rebm.formplugin;
import kd.bos.coderule.api.CodeRuleInfo;
import kd.bos.coderule.service.cache.CodeRuleCache;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.form.plugin.AbstractFormPlugin; import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.orm.query.QCP; import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter; import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.QueryServiceHelper;
import kd.bos.servicehelper.coderule.CodeRuleServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.bos.util.StringUtils;
import java.util.EventObject; import java.util.EventObject;
@ -20,6 +26,36 @@ public class PurDemandFormPlugin extends AbstractFormPlugin {
super.afterBindData(e); super.afterBindData(e);
//根据组织携带项目 //根据组织携带项目
updateRenovationProject(); updateRenovationProject();
DynamicObject dataEntity = this.getModel().getDataEntity(true);
if (StringUtils.isEmpty(dataEntity.getString("billno"))) {
QFilter q1 = new QFilter("number","=","CGXQ");
DynamicObject coderule = BusinessDataServiceHelper.loadSingle("bos_coderule", "id", new QFilter[]{q1});
if (null != coderule) {
CodeRuleInfo codeRule = CodeRuleCache.reloadCodeRuleById(coderule.getString("id"));
String number = CodeRuleServiceHelper.getNumber(codeRule, dataEntity);
String purissue = codeRuleNumberIsExits(number, codeRule, dataEntity);
this.getModel().setValue("billno", purissue);
}
}
}
/**
* 递归,若生成的采购单号已存在则重新生成
* @param purissue
* @param codeRule
* @param purapplybill
* @return
*/
public static String codeRuleNumberIsExits(String purissue,CodeRuleInfo codeRule,DynamicObject purapplybill){
QFilter filter = new QFilter("billno", QCP.equals,purissue);
boolean exists = QueryServiceHelper.exists("recon_settleplanbill", new QFilter[]{filter});
if(exists){
purissue = CodeRuleServiceHelper.getNumber(codeRule, purapplybill);
return codeRuleNumberIsExits(purissue,codeRule,purapplybill);
}else{
return purissue;
}
} }
@Override @Override
@ -55,11 +91,16 @@ public class PurDemandFormPlugin extends AbstractFormPlugin {
//采购项目 //采购项目
DynamicObject[] projectbills = BusinessDataServiceHelper.load("rebm_purproject", "id", DynamicObject[] projectbills = BusinessDataServiceHelper.load("rebm_purproject", "id",
new QFilter[]{new QFilter("org.id", QCP.equals, org.getPkValue())}); new QFilter[]{new QFilter("org.id", QCP.equals, org.getPkValue())});
DynamicObject projectbill = null;
if (projectbills.length > 0) { if (projectbills.length > 0) {
DynamicObject projectbill = projectbills[0]; projectbill = projectbills[0];
}else {
DynamicObject[] projectbillss = BusinessDataServiceHelper.load("rebm_purproject", "id",
new QFilter[]{new QFilter("number", QCP.equals, "XM-202412-008")});
projectbill = projectbillss[0];
}
this.getModel().setValue("qeug_renovation_proj", projectbill); this.getModel().setValue("qeug_renovation_proj", projectbill);
this.getView().updateView("qeug_renovation_proj"); this.getView().updateView("qeug_renovation_proj");
} }
}
} }

View File

@ -96,10 +96,15 @@ public class PurPlanFormPlugin extends AbstractBillPlugIn implements HyperLinkCl
//采购项目 //采购项目
DynamicObject[] projectbills = BusinessDataServiceHelper.load("rebm_purproject", "id", DynamicObject[] projectbills = BusinessDataServiceHelper.load("rebm_purproject", "id",
new QFilter[]{new QFilter("org.id", QCP.equals, org.getPkValue())}); new QFilter[]{new QFilter("org.id", QCP.equals, org.getPkValue())});
DynamicObject projectbill = null;
if (projectbills.length > 0) { if (projectbills.length > 0) {
DynamicObject projectbill = projectbills[0]; projectbill = projectbills[0];
this.getModel().setValue("purproject", projectbill); }else {
this.getView().updateView("purproject"); DynamicObject[] projectbillss = BusinessDataServiceHelper.load("rebm_purproject", "id",
} new QFilter[]{new QFilter("number", QCP.equals, "XM-202412-008")});
projectbill = projectbillss[0];
}
this.getModel().setValue("qeug_renovation_proj", projectbill);
this.getView().updateView("qeug_renovation_proj");
} }
} }

View File

@ -16,22 +16,22 @@ public class SupplierinvitaFormPlugin extends AbstractFormPlugin {
public void afterBindData(EventObject e) { public void afterBindData(EventObject e) {
super.afterBindData(e); super.afterBindData(e);
/** /*
* 供方入围 qeug_rebm_supplierinv_ext 供方入围 qeug_rebm_supplierinv_ext
* 标书编制 qeug_rebm_biddocument_ext 标书编制 qeug_rebm_biddocument_ext
* 标底编制 qeug_rebm_bottom_make_ext 标底编制 qeug_rebm_bottom_make_ext
* 招标交底 qeug_rebm_clarificait_ext 招标交底 qeug_rebm_clarificait_ext
* 技术标开标 技术标开标
* 技术标评标 技术标评标
* 商务标开标 商务标开标
* 商务标评标 商务标评标
* 发标 qeug_rebm_bidpublish_ext 发标 qeug_rebm_bidpublish_ext
* 开标 qeug_rebm_bidopen_ext 开标 qeug_rebm_bidopen_ext
* 答疑记录 qeug_rebm_answerques_ext1 答疑记录 qeug_rebm_answerques_ext1
* 在线评标 在线评标
* 评标 qeug_rebm_bidevaluati_ext 评标 qeug_rebm_bidevaluati_ext
* 商务谈判 qeug_rebm_bustalk_ext 商务谈判 qeug_rebm_bustalk_ext
* 定标 qeug_rebm_decision_ext 定标 qeug_rebm_decision_ext
*/ */
//业务类型携带 //业务类型携带
String qeugCombofield = (String)this.getModel().getValue("qeug_combofield"); String qeugCombofield = (String)this.getModel().getValue("qeug_combofield");

View File

@ -6,17 +6,11 @@ import kd.bos.entity.ExtendedDataEntity;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs; import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.validate.AbstractValidator; import kd.bos.entity.validate.AbstractValidator;
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.BusinessDataServiceHelper;
import kd.bos.util.StringUtils; import kd.bos.util.StringUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -25,22 +19,25 @@ import java.util.Map;
*/ */
public class PurProjectSubmitOPPlugin extends AbstractOperationServicePlugIn { public class PurProjectSubmitOPPlugin extends AbstractOperationServicePlugIn {
private static final Log logger = LogFactory.getLog(PurProjectSubmitOPPlugin.class);
@Override @Override
public void onAddValidators(AddValidatorsEventArgs e) { public void onAddValidators(AddValidatorsEventArgs e) {
super.onAddValidators(e); super.onAddValidators(e);
/*
校验金额逻辑
1)引用合约规划:遍历子单据体,取计划,需求均为空并且合约规划名称不为空的行,累加规划金额
2)引用采购计划:遍历子单据体,取计划不为空的行,穿透到计划中累加对应明细的控制金额
3)引用采购需求:合并相同的采购需求单,累加需求金额
*/
e.addValidator(new AbstractValidator() { e.addValidator(new AbstractValidator() {
@Override @Override
public void validate() { public void validate() {
String operateKey = this.getOperateKey(); String operateKey = this.getOperateKey();
ExtendedDataEntity[] dataEntities1 = this.getDataEntities(); ExtendedDataEntity[] dataEntities1 = this.getDataEntities();
switch (operateKey) { if ("submit".equals(operateKey)) {
case "submit":
for (ExtendedDataEntity extendedDataEntity : dataEntities1) { for (ExtendedDataEntity extendedDataEntity : dataEntities1) {
// 控制金额校验 // 控制金额校验
DynamicObject dataEntity = extendedDataEntity.getDataEntity(); DynamicObject dataEntity = extendedDataEntity.getDataEntity();
List<Long> ids = new ArrayList<>();
Map<Long, BigDecimal> XqMap = new HashMap<>(); Map<Long, BigDecimal> XqMap = new HashMap<>();
DynamicObjectCollection bidSections = dataEntity.getDynamicObjectCollection("bidsection"); // 标段 DynamicObjectCollection bidSections = dataEntity.getDynamicObjectCollection("bidsection"); // 标段
BigDecimal totalAmount = BigDecimal.ZERO; // 遍历明细, 需求单去重后累加申请金额, 非需求单累加规划金额 BigDecimal totalAmount = BigDecimal.ZERO; // 遍历明细, 需求单去重后累加申请金额, 非需求单累加规划金额
@ -113,11 +110,6 @@ public class PurProjectSubmitOPPlugin extends AbstractOperationServicePlugIn {
this.addErrorMessage(extendedDataEntity, "采购控制总金额不能大于采购申请总金额与规划金额之和"); this.addErrorMessage(extendedDataEntity, "采购控制总金额不能大于采购申请总金额与规划金额之和");
} }
} }
break;
default:
break;
} }
} }
}); });