供方入围新增供应商1.2

This commit is contained in:
zengweihai 2024-12-03 15:45:06 +08:00
parent 8ce3725701
commit d6f8ef5ec2
1 changed files with 30 additions and 5 deletions

View File

@ -12,6 +12,7 @@ import kd.bos.entity.datamodel.IEntryOperate;
import kd.bos.entity.datamodel.events.AfterAddRowEventArgs; import kd.bos.entity.datamodel.events.AfterAddRowEventArgs;
import kd.bos.entity.datamodel.events.ChangeData; import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.entity.operate.result.OperationResult;
import kd.bos.form.control.Button; import kd.bos.form.control.Button;
import kd.bos.form.control.Control; import kd.bos.form.control.Control;
import kd.bos.form.control.EntryGrid; import kd.bos.form.control.EntryGrid;
@ -23,6 +24,8 @@ import kd.bos.form.operate.FormOperate;
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.operation.DeleteServiceHelper;
import kd.bos.servicehelper.operation.OperationServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.repc.rebm.formplugin.bill.SupplierInvitationBidNumEdit; import kd.repc.rebm.formplugin.bill.SupplierInvitationBidNumEdit;
import kd.repc.resm.business.portrait.IPortraitService; import kd.repc.resm.business.portrait.IPortraitService;
@ -50,7 +53,7 @@ public class SupplierInvitationFormPlugin extends SupplierInvitationBidNumEdit {
super.beforeItemClick(evt); super.beforeItemClick(evt);
String itemKey = evt.getItemKey(); String itemKey = evt.getItemKey();
DynamicObject bidproject = (DynamicObject) this.getModel().getValue("bidproject"); DynamicObject bidproject = (DynamicObject) this.getModel().getValue("bidproject");
if ("addsupplierdetail".equals(itemKey)){ if ("addsupplierdetail".equals(itemKey) || "addsupplierenroll".equals(itemKey) ){
EntryGrid SEEntryGrid = this.getControl("supplierenrollentry"); EntryGrid SEEntryGrid = this.getControl("supplierenrollentry");
DynamicObjectCollection SEEntry = this.getModel().getEntryEntity("supplierenrollentry"); DynamicObjectCollection SEEntry = this.getModel().getEntryEntity("supplierenrollentry");
int[] selectRows = SEEntryGrid.getSelectRows(); int[] selectRows = SEEntryGrid.getSelectRows();
@ -58,13 +61,16 @@ public class SupplierInvitationFormPlugin extends SupplierInvitationBidNumEdit {
DynamicObject dy = SEEntry.get(selectRow); DynamicObject dy = SEEntry.get(selectRow);
DynamicObject enrollsupplier = dy.getDynamicObject("enrollsupplier");//报名供应商 DynamicObject enrollsupplier = dy.getDynamicObject("enrollsupplier");//报名供应商
if (enrollsupplier != null){ if (enrollsupplier != null){
Object enrollsupplierPkValue = enrollsupplier.getPkValue(); Object enrollsupplierPkValue = enrollsupplier.getPkValue();//syssupplier
boolean flag = checkSupplierCollection(enrollsupplierPkValue,bidproject); boolean flag = checkSupplierCollection(enrollsupplierPkValue,bidproject);
if (!flag){ if (!flag){
this.createRespMyTender(enrollsupplierPkValue); this.createRespMyTender(enrollsupplierPkValue);
DynamicObject dataEntity = this.getModel().getDataEntity(); DynamicObject dataEntity = this.getModel().getDataEntity(true);
SaveServiceHelper.save(new DynamicObject[]{dataEntity}); SaveServiceHelper.save(new DynamicObject[]{dataEntity});
} }
// else {
// this.updateSupplierCollection(enrollsupplierPkValue,bidproject,adminUserId);
// }
} }
} }
@ -122,6 +128,9 @@ public class SupplierInvitationFormPlugin extends SupplierInvitationBidNumEdit {
this.suppChanged("supplierentry", "bidnum", "abandonbidnum", newValue, rowIndex); this.suppChanged("supplierentry", "bidnum", "abandonbidnum", newValue, rowIndex);
}else if ("enrollsupplier".equals(name)) { }else if ("enrollsupplier".equals(name)) {
newValue = (DynamicObject)changeData.getNewValue(); newValue = (DynamicObject)changeData.getNewValue();
if (newValue == null) {
return;
}
this.suppChanged("supplierenrollentry", "enrollbidnum", "enrollabandonbidnum", newValue, rowIndex); this.suppChanged("supplierenrollentry", "enrollbidnum", "enrollabandonbidnum", newValue, rowIndex);
} }
} }
@ -184,7 +193,8 @@ public class SupplierInvitationFormPlugin extends SupplierInvitationBidNumEdit {
DynamicObject bid_project = BusinessDataServiceHelper.loadSingle(bidproject_pkValue, "rebm_bidproject_f7");//获取招标立项完整数据 DynamicObject bid_project = BusinessDataServiceHelper.loadSingle(bidproject_pkValue, "rebm_bidproject_f7");//获取招标立项完整数据
QFilter announcement_qf = new QFilter("project.id",QCP.equals,bidproject_pkValue);//查找招标公告 QFilter announcement_qf = new QFilter("project.id",QCP.equals,bidproject_pkValue);//查找招标公告
DynamicObject announcement = BusinessDataServiceHelper.loadSingle("ten_announcement_f7", announcement_qf.toArray()); DynamicObject announcement = BusinessDataServiceHelper.loadSingle("ten_announcement_f7", announcement_qf.toArray());
DynamicObject myTender = new DynamicObject(EntityMetadataCache.getDataEntityType("resp_mytender"));
DynamicObject myTender = BusinessDataServiceHelper.newDynamicObject("resp_mytender");
myTender.set("name", announcement.getString("annotitle"));//招标名称取招标立项名称 myTender.set("name", announcement.getString("annotitle"));//招标名称取招标立项名称
myTender.set("billstatus", "C");//默认设置状态为c myTender.set("billstatus", "C");//默认设置状态为c
myTender.set("org", bid_project.getDynamicObject("org")); myTender.set("org", bid_project.getDynamicObject("org"));
@ -193,8 +203,10 @@ public class SupplierInvitationFormPlugin extends SupplierInvitationBidNumEdit {
myTender.set("tenderstatus", MyTenderStatus.APPLIED);//投标状态, 供方入围添加默认设置为已入围 myTender.set("tenderstatus", MyTenderStatus.APPLIED);//投标状态, 供方入围添加默认设置为已入围
myTender.set("publishdate", announcement.getDate("publishdate"));//发布日期 myTender.set("publishdate", announcement.getDate("publishdate"));//发布日期
myTender.set("announcement", announcement);//招标公告 myTender.set("announcement", announcement);//招标公告
DynamicObject resm_official_supplier = BusinessDataServiceHelper.loadSingle(supplierId, "resm_official_supplier");
DynamicObject syssupplier = resm_official_supplier.getDynamicObject("syssupplier");//获取系统供应商
Long adminUserId = SupplierHelper.listAdminUserIdBySupplier(Long.parseLong(supplierId.toString())); Long adminUserId = SupplierHelper.listAdminUserIdBySupplier(Long.parseLong(syssupplier.getString("id")));
myTender.set("tenderer", adminUserId);//投标人 myTender.set("tenderer", adminUserId);//投标人
myTender.set("supplier", supplierId);//供应商 myTender.set("supplier", supplierId);//供应商
myTender.set("createtime", new Date());//创建日期 myTender.set("createtime", new Date());//创建日期
@ -224,9 +236,22 @@ public class SupplierInvitationFormPlugin extends SupplierInvitationBidNumEdit {
myTenderEntryColl.add(myTenderEntry); myTenderEntryColl.add(myTenderEntry);
} }
myTender.set("entry", myTenderEntryColl); myTender.set("entry", myTenderEntryColl);
// OperationResult operationResult = OperationServiceHelper.executeOperate("save", "resp_mytender", new DynamicObject[]{myTender});
SaveServiceHelper.save(new DynamicObject[]{myTender}); SaveServiceHelper.save(new DynamicObject[]{myTender});
} }
// public void updateSupplierCollection(Object supplierId,DynamicObject bidproject, Long adminUserId){
// QFilter mytender_QF = new QFilter("bidproject.id", QCP.equals, bidproject.getPkValue());
// mytender_QF.and("supplier.id",QCP.equals,supplierId);
// DynamicObject resp_mytender = BusinessDataServiceHelper.loadSingle("resp_mytender", mytender_QF.toArray());
// resp_mytender.set("tenderer",adminUserId);
// Object pkValue = resp_mytender.getPkValue();
// QFilter qFilter = new QFilter("id", QCP.equals, pkValue);
// this.getView().showTipNotification(resp_mytender.getPkValue().toString());
//// DeleteServiceHelper.delete("resp_mytender",qFilter.toArray());
// }
/** /**
* 校验供应商集合是否符合存在投标单 * 校验供应商集合是否符合存在投标单
* @param * @param