1.采购全流程携带(供方入围,标书编制,标底编制,招标交底,发标开标,答疑记录,评标谈判,定标)
2.立项提交时控制,立项控制金额不能大于采购计划的源单控制金额+申请单明细合并后申请金额+合约规划中规划金额 S
This commit is contained in:
parent
978f9ca88a
commit
df26e7a0c0
|
@ -0,0 +1,45 @@
|
||||||
|
package shkd.repc.rebm.formplugin;
|
||||||
|
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
import kd.bos.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.EventObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单头携带立项的业务体系(采购全流程携带字段)
|
||||||
|
*/
|
||||||
|
public class SupplierinvitaFormPlugin extends AbstractFormPlugin {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterBindData(EventObject e) {
|
||||||
|
super.afterBindData(e);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供方入围 qeug_rebm_supplierinv_ext
|
||||||
|
* 标书编制 qeug_rebm_biddocument_ext
|
||||||
|
* 标底编制 qeug_rebm_bottom_make_ext
|
||||||
|
* 招标交底 qeug_rebm_clarificait_ext
|
||||||
|
* 技术标开标
|
||||||
|
* 技术标评标
|
||||||
|
* 商务标开标
|
||||||
|
* 商务标评标
|
||||||
|
* 发标 qeug_rebm_bidpublish_ext
|
||||||
|
* 开标 qeug_rebm_bidopen_ext
|
||||||
|
* 答疑记录 qeug_rebm_answerques_ext1
|
||||||
|
* 在线评标
|
||||||
|
* 评标 qeug_rebm_bidevaluati_ext
|
||||||
|
* 商务谈判 qeug_rebm_bustalk_ext
|
||||||
|
* 定标 qeug_rebm_decision_ext
|
||||||
|
*/
|
||||||
|
//业务类型携带
|
||||||
|
String qeugCombofield = (String)this.getModel().getValue("qeug_combofield");
|
||||||
|
DynamicObject bidproject = (DynamicObject)this.getModel().getValue("bidproject");//招标名称_F7
|
||||||
|
if (StringUtils.isEmpty(qeugCombofield) && null != bidproject) {
|
||||||
|
DynamicObject project = BusinessDataServiceHelper.loadSingle(bidproject.getPkValue(), "rebm_project");//招标立项
|
||||||
|
this.getModel().setValue("qeug_combofield",project.getString("qeug_combofield"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -11,6 +11,7 @@ import kd.bos.logging.LogFactory;
|
||||||
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.util.StringUtils;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -37,45 +38,82 @@ public class PurProjectSubmitOPPlugin extends AbstractOperationServicePlugIn {
|
||||||
switch (operateKey) {
|
switch (operateKey) {
|
||||||
case "submit":
|
case "submit":
|
||||||
for (ExtendedDataEntity extendedDataEntity : dataEntities1) {
|
for (ExtendedDataEntity extendedDataEntity : dataEntities1) {
|
||||||
//控制金额校验
|
// 控制金额校验
|
||||||
DynamicObject dataEntity = extendedDataEntity.getDataEntity();
|
DynamicObject dataEntity = extendedDataEntity.getDataEntity();
|
||||||
List<Long> ids = new ArrayList<>();
|
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; // 遍历明细, 需求单去重后累加申请金额, 非需求单累加规划金额
|
||||||
|
|
||||||
if (bidSections != null) {
|
if (bidSections != null) {
|
||||||
for (DynamicObject bidSection : bidSections) {
|
for (DynamicObject bidSection : bidSections) {
|
||||||
DynamicObjectCollection projectEntries = bidSection.getDynamicObjectCollection("projectentry");//采购明细
|
DynamicObjectCollection projectEntries = bidSection.getDynamicObjectCollection("projectentry"); // 采购明细
|
||||||
|
|
||||||
if (projectEntries != null) {
|
if (projectEntries != null) {
|
||||||
for (DynamicObject projectEntry : projectEntries) {
|
for (DynamicObject projectEntry : projectEntries) {
|
||||||
long id = projectEntry.getLong("qeug_purentry_id");
|
long id = projectEntry.getLong("qeug_purentry_id");
|
||||||
//非采购需求,计算规划金额
|
|
||||||
if (id == 0) {
|
// 需求_对应金额, 若id相同, 覆盖
|
||||||
totalAmount = totalAmount.add(projectEntry.getBigDecimal("planamount"));
|
if (id != 0) {
|
||||||
}else {
|
|
||||||
//需求_对应金额,若id相同,覆盖
|
|
||||||
DynamicObject qeugCgxq = projectEntry.getDynamicObject("qeug_cgxq");
|
DynamicObject qeugCgxq = projectEntry.getDynamicObject("qeug_cgxq");
|
||||||
if (null != qeugCgxq) {
|
if (qeugCgxq != null) {
|
||||||
qeugCgxq = BusinessDataServiceHelper.loadSingle(qeugCgxq.getPkValue(),"recon_settleplanbill");
|
qeugCgxq = BusinessDataServiceHelper.loadSingle(qeugCgxq.getPkValue(), "recon_settleplanbill");
|
||||||
XqMap.put(qeugCgxq.getLong("id"), qeugCgxq.getBigDecimal("qeug_applyamount"));
|
if (qeugCgxq != null) {
|
||||||
|
XqMap.put(qeugCgxq.getLong("id"), qeugCgxq.getBigDecimal("qeug_applyamount"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 非采购需求
|
||||||
|
else {
|
||||||
|
String purplanname = projectEntry.getString("purplanname"); // 采购计划名称
|
||||||
|
DynamicObject programcontract = projectEntry.getDynamicObject("programcontract"); // 合约规划
|
||||||
|
DynamicObject cqprogcon = projectEntry.getDynamicObject("cqprogcon"); // 合约规划树形
|
||||||
|
|
||||||
|
// 合约规划
|
||||||
|
if (StringUtils.isEmpty(purplanname) && projectEntry.getDynamicObject("qeug_cgxq") == null) {
|
||||||
|
if (programcontract != null || cqprogcon != null) {
|
||||||
|
totalAmount = totalAmount.add(projectEntry.getBigDecimal("planamount"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 采购计划
|
||||||
|
if (!StringUtils.isEmpty(purplanname)) {
|
||||||
|
DynamicObject purplanentry = projectEntry.getDynamicObject("purplanentry"); // 采购计划分录
|
||||||
|
if (purplanentry != null) {
|
||||||
|
purplanentry = BusinessDataServiceHelper.loadSingle(purplanentry.getPkValue(), "rebm_purplanentry_f7");
|
||||||
|
DynamicObject purplan = purplanentry.getDynamicObject("purplan");
|
||||||
|
if (purplan != null) {
|
||||||
|
DynamicObject rebm_purplan = BusinessDataServiceHelper.loadSingle(purplan.getPkValue(), "rebm_purplan");
|
||||||
|
DynamicObjectCollection collection = rebm_purplan.getDynamicObjectCollection("entryentity");
|
||||||
|
|
||||||
|
for (DynamicObject dynamicObject : collection) {
|
||||||
|
long id1 = purplanentry.getLong("id"); // 计划分录id
|
||||||
|
long id2 = dynamicObject.getLong("id");
|
||||||
|
if (id1 == id2) {
|
||||||
|
totalAmount = totalAmount.add(dynamicObject.getBigDecimal("prucontrolamount"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!XqMap.isEmpty()) {
|
|
||||||
for (Map.Entry<Long, BigDecimal> entry : XqMap.entrySet()) {
|
// 累加需求对应金额
|
||||||
BigDecimal value = entry.getValue();
|
for (BigDecimal value : XqMap.values()) {
|
||||||
totalAmount = totalAmount.add(value);
|
totalAmount = totalAmount.add(value);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//采购立项_采购控制总金额(单头)
|
|
||||||
|
// 采购立项_采购控制总金额(单头)
|
||||||
BigDecimal totalcontrol = dataEntity.getBigDecimal("totalcontrol");
|
BigDecimal totalcontrol = dataEntity.getBigDecimal("totalcontrol");
|
||||||
if (totalcontrol.compareTo(totalAmount) > 0) {
|
if (totalcontrol.compareTo(totalAmount) > 0) {
|
||||||
this.addErrorMessage(extendedDataEntity, "采购控制总金额不能大于采购申请总金额与规划金额之和");
|
this.addErrorMessage(extendedDataEntity, "采购控制总金额不能大于采购申请总金额与规划金额之和");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue