1.供应商门户模糊查询公告

S
This commit is contained in:
weiyunlong 2025-01-02 10:08:59 +08:00
parent 0f41c883f0
commit 9e5f04fe5f
3 changed files with 196 additions and 25 deletions

View File

@ -0,0 +1,165 @@
package shkd.repc.resp.formplugin;
import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.bill.OperationStatus;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.datamodel.IDataModel;
import kd.bos.form.CloseCallBack;
import kd.bos.form.FormShowParameter;
import kd.bos.form.IFormView;
import kd.bos.form.ShowType;
import kd.bos.form.control.EntryGrid;
import kd.bos.form.control.Search;
import kd.bos.form.events.HyperLinkClickEvent;
import kd.bos.form.events.HyperLinkClickListener;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.list.BillList;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.util.StringUtils;
import kd.repc.common.enums.resm.AnnoRecruitEnum;
import kd.scm.bid.common.enums.BillStatusEnum;
import kd.scm.bid.formplugin.bill.helper.TemplateManageHelper;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.EventObject;
/**
* 公告汇总卡片
* qeug_card_summary_new
*/
public class CardSummaryFormPlugin extends AbstractBillPlugIn implements HyperLinkClickListener {
@Override
public void afterBindData(EventObject e) {
super.afterBindData(e);
Search search = this.getView().getParentView().getControl("qeug_searchap");
String searchKey = search.getSearchKey();
/**
* 招募公告(resm_annorecruit) t_resm_annorecruit
* 招标公告(rebm_project_announcement) t_bid_announcement
* '中标'公告(rebm_announcement) t_bid_announcement
*/
QFilter Q1 = new QFilter("annorecruittitle", QCP.like, "%"+searchKey+"%");
if (StringUtils.isEmpty(searchKey)) {
Q1 = null;
}
QFilter qfilter2 = (new QFilter("publishstatus", "=", AnnoRecruitEnum.RELEASED.getValue())).
and("recruitdeadline", ">=", new Date());
DynamicObjectCollection qeugEntryentity = this.getView().getModel().getEntryEntity("qeug_entryentity");
DynamicObject[] resm_annorecruits = BusinessDataServiceHelper.load("resm_annorecruit",
"id,annorecruittitle,publishdate", new QFilter[]{Q1,qfilter2});
// "id,annorecruittitle,publishdate", null);
for (DynamicObject resmAnnorecruit : resm_annorecruits) {
DynamicObject add = qeugEntryentity.addNew();
add.set("qeug_name", resmAnnorecruit.getString("annorecruittitle"));
add.set("qeug_type", "招募公告");
add.set("qeug_sourceid", String.valueOf(resmAnnorecruit.getLong("id")));
Date publishdate = resmAnnorecruit.getDate("publishdate");
if (null != publishdate) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = sdf.format(publishdate);
add.set("qeug_date", formattedDate);
}
}
QFilter Q2 = new QFilter("annotitle", QCP.like, "%"+searchKey+"%");
if (StringUtils.isEmpty(searchKey)) {
Q2 = null;
}
QFilter qfilter1 = (new QFilter("annotype", "=", "bidproject")).and("billstatus",
"=", BillStatusEnum.AUDITED.getVal()).and("entitytypeid", "=", "rebm_announcement").
and("signendtime", ">=", new Date()).and("publishstatus", "=", "L");
DynamicObject[] rebm_project_announcements = BusinessDataServiceHelper.load("rebm_project_announcement",
"id,annotitle,publishdate", new QFilter[]{Q2,qfilter1});
// "id,annotitle,publishdate", null);
for (DynamicObject rebmProjectAnnouncement : rebm_project_announcements) {
DynamicObject add = qeugEntryentity.addNew();
add.set("qeug_name", rebmProjectAnnouncement.getString("annotitle"));
add.set("qeug_type", "招标公告");
add.set("qeug_sourceid", String.valueOf(rebmProjectAnnouncement.getLong("id")));
Date publishdate = rebmProjectAnnouncement.getDate("publishdate");
if (null != publishdate) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = sdf.format(publishdate);
add.set("qeug_date", formattedDate);
}
}
QFilter qfilter = (new QFilter("annotype", "=", "decision")).
and("billstatus", "=", BillStatusEnum.AUDITED.getVal()).and("publishstatus", "=",
BillStatusEnum.RELEASED.getVal()).and("entitytypeid", "=", "rebm_announcement");
DynamicObject[] rebm_announcements = BusinessDataServiceHelper.load("rebm_announcement",
"id,annotitle,publishdate", new QFilter[]{Q2,qfilter});
// "id,annotitle,publishdate",null);
for (DynamicObject rebmAnnouncement : rebm_announcements) {
DynamicObject add = qeugEntryentity.addNew();
add.set("qeug_name", rebmAnnouncement.getString("annotitle"));
add.set("qeug_type", "中标公告");
add.set("qeug_sourceid", String.valueOf(rebmAnnouncement.getLong("id")));
Date publishdate = rebmAnnouncement.getDate("publishdate");
if (null != publishdate) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = sdf.format(publishdate);
add.set("qeug_date", formattedDate);
}
}
this.getView().updateView("qeug_entryentity");
}
// public void registerListener(EventObject eventobject) {
// super.registerListener(eventobject);
// EntryGrid billList = (EntryGrid)this.getView().getControl("qeug_entryentity");
// billList.addHyperClickListener(this);
// }
@Override
public void registerListener(EventObject e) {
super.registerListener(e);
EntryGrid billList = this.getView().getControl("qeug_entryentity");
billList.addHyperClickListener(this);
}
@Override
public void hyperLinkClick(HyperLinkClickEvent hyperlinkclickevent) {
// EntryGrid grid = (EntryGrid )hyperlinkclickevent.getSource();
// Long annoId = Long.valueOf(grid.getId());
String annoId = "";
String clickEventFieldName = hyperlinkclickevent.getFieldName();
if ("qeug_name".equals(clickEventFieldName)) {
int rowIndex = hyperlinkclickevent.getRowIndex();
DynamicObjectCollection billentry = this.getModel().getDataEntity(Boolean.TRUE).getDynamicObjectCollection("qeug_entryentity");
if (!billentry.isEmpty()) {
annoId = billentry.get(rowIndex).getString("qeug_sourceid");
String browsertabname = (String)this.getView().getFormShowParameter().getCustomParam("browsertabname");
FormShowParameter showParameter = new FormShowParameter();
String qeugType = billentry.get(rowIndex).getString("qeug_type");
if ("招募公告".equals(qeugType)) {
showParameter.setFormId("resm_annorecruit_preview");
showParameter.setStatus(OperationStatus.VIEW);
showParameter.setCustomParam("annoId", Long.valueOf(annoId));
showParameter.getOpenStyle().setShowType(ShowType.Modal);
showParameter.setCustomParam("browsertabname", browsertabname);
showParameter.setCloseCallBack(new CloseCallBack(this, "browsertabname"));
}
if ("中标公告".equals(qeugType) || "招标公告".equals(qeugType)) {
TemplateManageHelper detailInformationHelper = new TemplateManageHelper();
showParameter = detailInformationHelper.getAnnoShowParameter("rebm", detailInformationHelper.getAnnoInvititle(), Long.valueOf(annoId));
showParameter.setCustomParam("browsertabname", browsertabname);
showParameter.getOpenStyle().setShowType(ShowType.Modal);
showParameter.setCloseCallBack(new CloseCallBack(this, "browsertabname"));
}
this.getView().showForm(showParameter);
}
}
}
}

View File

@ -50,9 +50,18 @@ public class PortalFormPlugin extends AbstractFormPlugin implements SearchEnterL
@Override
public void search(SearchEnterEvent searchEnterEvent) {
List<String> fieldNames = searchEnterEvent.getFieldNames();
String string = fieldNames.get(0);
SEARCHAP = string;
// List<String> fieldNames = searchEnterEvent.getFieldNames();
// String string = fieldNames.get(0);
// SEARCHAP = string;
// String portalConfigId = getPortalConfigId();
// Search search = this.getView().getControl("qeug_searchap");
// String searchKey = search.getSearchKey();
//
// this.loadCards(portalConfigId, this.getCardInfoQeug("summary"), (Map)null);
// this.getView().getModel().setValue("showcontrol", "query");
// search.setSearchKey("");
}
public void click(EventObject eventobject) {
@ -65,14 +74,11 @@ public class PortalFormPlugin extends AbstractFormPlugin implements SearchEnterL
switch (key) {
case "qeug_buttonap":
this.getControl("");
// (new PortalLableStyleChangeUtil()).addClickedLableStyle(view, "qeug_buttonap", ResManager.loadKDString("查询", "IndexEditNew_4", "repc-resp-formplugin", new Object[0]));
String str = SEARCHAP;
Search search = this.getView().getControl("qeug_searchap");
String searchKey = search.getSearchKey();
this.loadCards(portalConfigId, this.getCardInfoQeug("summary"), (Map)null);
this.getView().getModel().setValue("showcontrol", "query");
search.setSearchKey("");
// search.setSearchKey("");
break;
}
@ -140,23 +146,23 @@ public class PortalFormPlugin extends AbstractFormPlugin implements SearchEnterL
public void beforeDoOperation(BeforeDoOperationEventArgs args) {
super.beforeDoOperation(args);
FormOperate operate = (FormOperate) args.getSource();
String key = operate.getOperateKey();
String[] switchKeys = new String[]{"query"};
List<String> switchKeyList = CollectionUtils.arrayToList(switchKeys);
String globalSessionId;
if (switchKeyList.contains(key)) {
// this.setHeadflexpanelBackgroundImg(true);
// globalSessionId = this.getPageCache().get("registeredid");
// if (!StringUtils.isEmpty(globalSessionId)) {
// this.getView().setVisible(Boolean.FALSE, new String[]{"btn_templogin", "link_login", "label_regist"});
// this.getView().setVisible(Boolean.TRUE, new String[]{"label_logintip", "btn_exit"});
// } else {
// this.getView().setVisible(Boolean.TRUE, new String[]{"btn_templogin", "link_login", "label_regist"});
// this.getView().setVisible(Boolean.FALSE, new String[]{"label_logintip", "btn_exit"});
// FormOperate operate = (FormOperate) args.getSource();
// String key = operate.getOperateKey();
// String[] switchKeys = new String[]{"query"};
// List<String> switchKeyList = CollectionUtils.arrayToList(switchKeys);
// String globalSessionId;
// if (switchKeyList.contains(key)) {
//// this.setHeadflexpanelBackgroundImg(true);
//// globalSessionId = this.getPageCache().get("registeredid");
//// if (!StringUtils.isEmpty(globalSessionId)) {
//// this.getView().setVisible(Boolean.FALSE, new String[]{"btn_templogin", "link_login", "label_regist"});
//// this.getView().setVisible(Boolean.TRUE, new String[]{"label_logintip", "btn_exit"});
//// } else {
//// this.getView().setVisible(Boolean.TRUE, new String[]{"btn_templogin", "link_login", "label_regist"});
//// this.getView().setVisible(Boolean.FALSE, new String[]{"label_logintip", "btn_exit"});
//// }
//
// }
}
}
public void setHeadflexpanelBackgroundImg(boolean flag) {

View File

@ -253,7 +253,7 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler {
Long userId = UserServiceHelper.getCurrentUserId();
DynamicObject bos_user = BusinessDataServiceHelper.loadSingle(userId, "bos_user");
String username = bos_user.getString("username");
// String username = bos_user.getString("username");
String billNo = "";
Long taskId = 0L;
if (params != null) {