|
|
@@ -1,12 +1,16 @@
|
|
|
package nckd.jxccl.hrmp.hbpm.plugin.form.hr;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.Maps;
|
|
|
+import com.google.common.collect.Sets;
|
|
|
import kd.bos.bill.BillOperationStatus;
|
|
|
import kd.bos.bill.BillShowParameter;
|
|
|
import kd.bos.bill.OperationStatus;
|
|
|
import kd.bos.context.RequestContext;
|
|
|
+import kd.bos.dataentity.OperateOption;
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
+import kd.bos.dataentity.entity.LocaleString;
|
|
|
import kd.bos.dataentity.metadata.IDataEntityProperty;
|
|
|
import kd.bos.dataentity.metadata.IDataEntityType;
|
|
|
import kd.bos.dataentity.serialization.SerializationUtils;
|
|
|
@@ -17,6 +21,8 @@ import kd.bos.entity.datamodel.IDataModel;
|
|
|
import kd.bos.entity.datamodel.ListSelectedRow;
|
|
|
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
|
|
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
|
|
+import kd.bos.entity.operate.OperateOptionConst;
|
|
|
+import kd.bos.entity.operate.result.IOperateInfo;
|
|
|
import kd.bos.entity.operate.result.OperationResult;
|
|
|
import kd.bos.entity.property.BasedataProp;
|
|
|
import kd.bos.ext.hr.entity.property.PositionFieldProp;
|
|
|
@@ -31,14 +37,18 @@ import kd.bos.form.control.EntryGrid;
|
|
|
import kd.bos.form.control.events.EntryGridBindDataListener;
|
|
|
import kd.bos.form.events.AfterDoOperationEventArgs;
|
|
|
import kd.bos.form.events.BeforeClosedEvent;
|
|
|
+import kd.bos.form.events.BeforeDoOperationEventArgs;
|
|
|
import kd.bos.form.events.ClosedCallBackEvent;
|
|
|
+import kd.bos.form.events.LoadCustomControlMetasArgs;
|
|
|
import kd.bos.form.events.MessageBoxClosedEvent;
|
|
|
import kd.bos.form.field.BasedataEdit;
|
|
|
import kd.bos.form.field.events.BeforeBasedataSetValueEvent;
|
|
|
import kd.bos.form.field.events.BeforeBasedataSetValueListener;
|
|
|
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
|
|
import kd.bos.form.field.events.BeforeF7SelectListener;
|
|
|
+import kd.bos.form.operate.AbstractOperate;
|
|
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
|
|
+import kd.bos.lang.Lang;
|
|
|
import kd.bos.list.ListShowParameter;
|
|
|
import kd.bos.logging.Log;
|
|
|
import kd.bos.logging.LogFactory;
|
|
|
@@ -48,6 +58,9 @@ import kd.bos.orm.query.QFilter;
|
|
|
import kd.bos.orm.util.CollectionUtils;
|
|
|
import kd.bos.permission.api.HasPermOrgResult;
|
|
|
import kd.bos.servicehelper.basedata.BaseDataServiceHelper;
|
|
|
+import kd.bos.servicehelper.coderule.CodeRuleServiceHelper;
|
|
|
+import kd.bos.servicehelper.model.PermissionStatus;
|
|
|
+import kd.bos.servicehelper.org.OrgViewType;
|
|
|
import kd.bos.servicehelper.permission.PermissionServiceHelper;
|
|
|
import kd.hr.hbp.business.servicehelper.HRBaseServiceHelper;
|
|
|
import kd.hr.hbp.common.model.AuthorizedOrgResult;
|
|
|
@@ -58,6 +71,7 @@ import kd.hr.hbp.common.util.HRStringUtils;
|
|
|
import kd.hr.hbp.common.util.concurrent.NullableConcurrentHashMap;
|
|
|
import kd.sdk.hr.hdm.common.enums.reg.RegBillStatusEnum;
|
|
|
import nckd.jxccl.hrmp.hbpm.business.service.hr.PositionBillAfterBindDataService;
|
|
|
+import nckd.jxccl.hrmp.hbpm.business.service.hr.PositionBillBeforeBindDataService;
|
|
|
import nckd.jxccl.hrmp.hbpm.business.service.hr.PositionBillClosedCallBackService;
|
|
|
import nckd.jxccl.hrmp.hbpm.business.service.hr.PositionBillConfirmCallBackService;
|
|
|
import nckd.jxccl.hrmp.hbpm.business.service.hr.PositionBillPropertyChangedService;
|
|
|
@@ -78,6 +92,7 @@ import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* 岗位申请单表单插件
|
|
|
+ * @entity: nckd_positionbill
|
|
|
* @from: kd.hr.homs.formplugin.web.orgbatch.AdminOrgBatchBillPlugin
|
|
|
* @author: jtd
|
|
|
* @date: 2025-10-25 13:38
|
|
|
@@ -86,6 +101,78 @@ public class PositionBillFormPlugin extends AbstractFormPlugin implements Before
|
|
|
private static final Log LOG = LogFactory.getLog(PositionBillFormPlugin.class);
|
|
|
private final Map<String, Map<?, DynamicObject>> baseDataCacheMap = new NullableConcurrentHashMap(3);
|
|
|
|
|
|
+ @Override
|
|
|
+ public void afterCreateNewData(EventObject e) {
|
|
|
+ DynamicObject org = getModel().getDataEntity().getDynamicObject(PositionBillConstant.ORG_KEY);
|
|
|
+ if (org == null) {
|
|
|
+ // 获取是否有查询权限
|
|
|
+ HasPermOrgResult hrPermOrg = PermissionServiceHelper.getAllPermOrgs(RequestContext.get().getCurrUserId(), OrgViewType.HR_OD, getView().getFormShowParameter().getCheckRightAppId(), PositionBillConstant.HAOS_ADMINORGDETAIL_ENTITY, PermissionStatus.View, true);
|
|
|
+ List<Long> hasPermOrgs = hrPermOrg.getHasPermOrgs();
|
|
|
+ if (!Objects.isNull(hasPermOrgs) && hasPermOrgs.size() != 0) {
|
|
|
+ if (hasPermOrgs.contains(RequestContext.get().getOrgId())) {
|
|
|
+ getModel().setValue(PositionBillConstant.ORG_KEY, RequestContext.get().getOrgId());
|
|
|
+ } else {
|
|
|
+ getModel().setValue(PositionBillConstant.ORG_KEY, hasPermOrgs.get(0));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ LOG.error("PositionBillFormPlugin can not get any org");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ org = getModel().getDataEntity().getDynamicObject(PositionBillConstant.ORG_KEY);
|
|
|
+ if (org == null) {
|
|
|
+ setBillNo(e);
|
|
|
+ } else {
|
|
|
+ long orgid = org.getLong(PositionBillConstant.ID_KEY);
|
|
|
+ boolean cudeRule = CodeRuleServiceHelper.isExist(PositionBillConstant.NCKD_POSITIONBILL_ENTITY, getModel().getDataEntity(), String.valueOf(orgid));
|
|
|
+ if (!cudeRule) {
|
|
|
+ setBillNo(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setBillNo(EventObject e) {
|
|
|
+ Map map = new HashMap();
|
|
|
+ Map item = new HashMap();
|
|
|
+ Map emptyTip = new HashMap();
|
|
|
+ map.put("item", item);
|
|
|
+ item.put("emptytip", emptyTip);
|
|
|
+ Lang lang = Lang.get();
|
|
|
+ emptyTip.put(lang.getLocale(), "");
|
|
|
+ getView().updateControlMetadata(PositionBillConstant.BILL_NO_KEY, map);
|
|
|
+ getModel().setValue(PositionBillConstant.BILL_NO_KEY, "");
|
|
|
+ getView().setEnable(Boolean.TRUE, PositionBillConstant.BILL_NO_KEY);
|
|
|
+ super.afterCreateNewData(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void loadCustomControlMetas(LoadCustomControlMetasArgs e) {
|
|
|
+ super.loadCustomControlMetas(e);
|
|
|
+ BillShowParameter billShowParameter = (BillShowParameter) e.getSource();
|
|
|
+ LocaleString caption = billShowParameter.getFormConfig().getCaption();
|
|
|
+ if (billShowParameter.getPkId() == null) {
|
|
|
+ caption.setLocaleValue("岗位调整申请");
|
|
|
+ } else {
|
|
|
+ HRBaseServiceHelper hrBaseServiceHelper = new HRBaseServiceHelper(PositionBillConstant.NCKD_POSITIONBILL_ENTITY);
|
|
|
+ DynamicObject billObject = hrBaseServiceHelper.queryOne(String.join(",", PositionBillConstant.ID_KEY, PositionBillConstant.BILL_NO_KEY), billShowParameter.getPkId());
|
|
|
+ if (billObject != null) {
|
|
|
+ caption.setLocaleValue(String.format(Locale.ROOT, "岗位调整申请-%s", billObject.getString("billno")));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void beforeBindData(EventObject e) {
|
|
|
+ super.beforeBindData(e);
|
|
|
+
|
|
|
+ long startTime = System.currentTimeMillis();
|
|
|
+ PositionBillBeforeBindDataService beforeBindDataService = new PositionBillBeforeBindDataService(getView());
|
|
|
+ beforeBindDataService.beforeBindData(e);
|
|
|
+ LOG.info(String.format(Locale.ROOT, "PositionBillFormPlugin beforeBindData() time cost is: %s", System.currentTimeMillis() - startTime));
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void afterBindData(EventObject e) {
|
|
|
super.afterBindData(e);
|
|
|
@@ -128,44 +215,6 @@ public class PositionBillFormPlugin extends AbstractFormPlugin implements Before
|
|
|
propertyChangedService.propertyChanged(e);
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
|
|
|
- super.afterDoOperation(afterDoOperationEventArgs);
|
|
|
-
|
|
|
- OperationStatus status = getView().getFormShowParameter().getStatus();
|
|
|
- if (HRStringUtils.equals(getView().getFormShowParameter().getAppId(), PositionBillConstant.WFTASK_APP)) {
|
|
|
- ((BillView) getView()).setBillStatus(BillOperationStatus.EDIT);
|
|
|
- getView().getFormShowParameter().setStatus(OperationStatus.EDIT);
|
|
|
- ((BillShowParameter) getView().getFormShowParameter()).setBillStatus(BillOperationStatus.EDIT);
|
|
|
- String billStatus = ((BillEntityType) getModel().getDataEntityType()).getBillStatus();
|
|
|
- getModel().setValue(billStatus, "A");
|
|
|
- getModel().setDataChanged(Boolean.FALSE);
|
|
|
- }
|
|
|
-
|
|
|
- OperationResult afterOperationResult = afterDoOperationEventArgs.getOperationResult();
|
|
|
- if (!(afterOperationResult == null || afterOperationResult.isSuccess())) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- String opKey = afterDoOperationEventArgs.getOperateKey();
|
|
|
- switch (opKey) {
|
|
|
- case PositionBillConstant.NEWENTRY_ADD_OP:
|
|
|
- PositionBillServiceHelper.openViewForm(getView(), PositionBillConstant.ADD_TAG, getPluginName(), null);
|
|
|
- break;
|
|
|
- case PositionBillConstant.EDIT_ADD_OP:
|
|
|
- openEditAddPage(status, getModel(), getView());
|
|
|
- break;
|
|
|
- case PositionBillConstant.EDIT_CHANGE_OP:
|
|
|
- PositionBillServiceHelper.entryEntityMore(getModel(), getView(), PositionBillConstant.CHANGE_TAG, status, getPluginName());
|
|
|
- break;
|
|
|
- case PositionBillConstant.DELETE_ROWS_ADD_OP:
|
|
|
- case PositionBillConstant.DELETE_ROWS_CHANGE_OP:
|
|
|
- deleteRowsConfirm(opKey);
|
|
|
- break;
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
public void confirmCallBack(MessageBoxClosedEvent event) {
|
|
|
super.confirmCallBack(event);
|
|
|
|
|
|
@@ -219,14 +268,161 @@ public class PositionBillFormPlugin extends AbstractFormPlugin implements Before
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private boolean executeSaveOperation(String operateKey, OperateOption operateOption) {
|
|
|
+ OperateOption option = OperateOption.create();
|
|
|
+ if (operateOption != null) {
|
|
|
+ option.mergeValue(operateOption);
|
|
|
+ }
|
|
|
+
|
|
|
+ option.setVariableValue(OperateOptionConst.MUTEX_IGNORE_VALIDATION, Boolean.TRUE.toString());
|
|
|
+ option.setVariableValue(PositionBillConstant.OP_OPERATE_KEY, operateKey);
|
|
|
+ option.setVariableValue(OperateOptionConst.ISSHOWMESSAGE, Boolean.FALSE.toString());
|
|
|
+ OperationResult saveOperationResult = getView().invokeOperation(PositionBillConstant.SAVE_NO_LOG_OP, option);
|
|
|
+ if (!saveOperationResult.isSuccess()) {
|
|
|
+ getView().showOperationResult(saveOperationResult);
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void beforeDoOperation(BeforeDoOperationEventArgs args) {
|
|
|
+ super.beforeDoOperation(args);
|
|
|
+ AbstractOperate operate = (AbstractOperate) args.getSource();
|
|
|
+ String operateKey = operate.getOperateKey();
|
|
|
+ OperateOption option = operate.getOption();
|
|
|
+ if (getAllEntrySize() == 0) {
|
|
|
+ option.setVariableValue(OperateOptionConst.ISHASRIGHT, Boolean.TRUE.toString());
|
|
|
+ option.setVariableValue(OperateOptionConst.SKIPCHECKPERMISSION, Boolean.TRUE.toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (HRStringUtils.equals("import_multientry_hr", operate.getOperateKey())) {
|
|
|
+ if (getModel().getValue(PositionBillConstant.ORG_KEY) == null) {
|
|
|
+ getView().showTipNotification("请先填写组织体系管理组织。");
|
|
|
+ args.setCancel(Boolean.TRUE);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ DynamicObject dataEntity = getModel().getDataEntity(Boolean.TRUE);
|
|
|
+ long billId = dataEntity.getLong(PositionBillConstant.ID_KEY);
|
|
|
+ HRBaseServiceHelper serviceHelper = new HRBaseServiceHelper(PositionBillConstant.NCKD_POSITIONBILL_ENTITY);
|
|
|
+ DynamicObject[] dynamicObjects = serviceHelper.query(PositionBillConstant.BILL_STATUS_KEY, new QFilter[]{new QFilter(PositionBillConstant.ID_KEY, QCP.equals, billId)});
|
|
|
+ if (dynamicObjects.length > 0 && !Sets.newHashSet(new String[]{RegBillStatusEnum.TEMPSTORAGE.getCode(), RegBillStatusEnum.WAITRESUBMIT.getCode()}).contains(dynamicObjects[0].getString(PositionBillConstant.BILL_STATUS_KEY))) {
|
|
|
+ String auditStatus = dynamicObjects[0].getString(PositionBillConstant.BILL_STATUS_KEY);
|
|
|
+ getView().showTipNotification(String.format(Locale.ROOT, "%s的单据不能导入。", RegBillStatusEnum.getName(auditStatus)));
|
|
|
+ args.setCancel(Boolean.TRUE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (HRStringUtils.equalsAny(operateKey, PositionBillConstant.SAVE_OP, PositionBillConstant.SUBMIT_OP, PositionBillConstant.SUBMITEFFECT_OP)) {
|
|
|
+ if (HRStringUtils.equals(operateKey, PositionBillConstant.SUBMIT_OP) || HRStringUtils.equals(operateKey, PositionBillConstant.SUBMITEFFECT_OP)) {
|
|
|
+ if (!executeSaveOperation(operateKey, operate.getOption())) {
|
|
|
+ args.setCancel(true);
|
|
|
+ } else {
|
|
|
+ option.setVariableValue(OperateOptionConst.MUTEX_IGNORE_VALIDATION, Boolean.TRUE.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (PositionBillConstant.DELETE_ROWS_ADD_OP.equals(operateKey)) {
|
|
|
+ EntryGrid entryGrid = getView().getControl(PositionBillConstant.NCKD_ENTRYENTITY_ADD_KEY);
|
|
|
+ int[] selectRows = entryGrid.getSelectRows();
|
|
|
+ operate.getOption().setVariableValue(PositionBillConstant.OP_ROW_INDEX, JSONObject.toJSONString(selectRows));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (HRStringUtils.equals(getView().getFormShowParameter().getAppId(), PositionBillConstant.WFTASK_APP)) {
|
|
|
+ option.setVariableValue(OperateOptionConst.ISHASRIGHT, Boolean.TRUE.toString());
|
|
|
+ option.setVariableValue(OperateOptionConst.SKIPCHECKPERMISSION, Boolean.TRUE.toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void afterDoOperation(AfterDoOperationEventArgs eventArgs) {
|
|
|
+ super.afterDoOperation(eventArgs);
|
|
|
+
|
|
|
+ OperationStatus status = getView().getFormShowParameter().getStatus();
|
|
|
+ if (HRStringUtils.equals(getView().getFormShowParameter().getAppId(), PositionBillConstant.WFTASK_APP)) {
|
|
|
+ ((BillView) getView()).setBillStatus(BillOperationStatus.EDIT);
|
|
|
+ getView().getFormShowParameter().setStatus(OperationStatus.EDIT);
|
|
|
+ ((BillShowParameter) getView().getFormShowParameter()).setBillStatus(BillOperationStatus.EDIT);
|
|
|
+ String billStatus = ((BillEntityType) getModel().getDataEntityType()).getBillStatus();
|
|
|
+ getModel().setValue(billStatus, RegBillStatusEnum.TEMPSTORAGE.getCode());
|
|
|
+ getModel().setDataChanged(Boolean.FALSE);
|
|
|
+ }
|
|
|
+
|
|
|
+ String opKey = eventArgs.getOperateKey();
|
|
|
+ if (!PositionBillConstant.VIEWFLOWCHART_OP.equals(opKey)) {
|
|
|
+ OperationResult afterOperationResult = eventArgs.getOperationResult();
|
|
|
+ if (afterOperationResult != null && !afterOperationResult.isSuccess()) {
|
|
|
+ if (PositionBillConstant.SUBMIT_OP.equals(opKey)) {
|
|
|
+ afterSubmitError(afterOperationResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ switch (opKey) {
|
|
|
+ case PositionBillConstant.NEWENTRY_ADD_OP:
|
|
|
+ PositionBillServiceHelper.openViewForm(getView(), PositionBillConstant.ADD_TAG, getPluginName(), null);
|
|
|
+ break;
|
|
|
+ case PositionBillConstant.EDIT_ADD_OP:
|
|
|
+ openEditAddPage(status, getModel(), getView());
|
|
|
+ break;
|
|
|
+ case PositionBillConstant.EDIT_CHANGE_OP:
|
|
|
+ PositionBillServiceHelper.entryEntityMore(getModel(), getView(), PositionBillConstant.CHANGE_TAG, status, getPluginName());
|
|
|
+ break;
|
|
|
+ case PositionBillConstant.DELETE_ROWS_ADD_OP:
|
|
|
+ case PositionBillConstant.DELETE_ROWS_CHANGE_OP:
|
|
|
+ deleteRowsConfirm(opKey);
|
|
|
+ break;
|
|
|
+ case PositionBillConstant.SUBMIT_OP:
|
|
|
+ afterSubmit();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void afterSubmitError(OperationResult operationResult) {
|
|
|
+ boolean needWfAssignPersons = operationResult.isNeedWfAssignPersons();
|
|
|
+ List<IOperateInfo> allErrorOrValidateInfo = operationResult.getAllErrorOrValidateInfo();
|
|
|
+ String errorMsg;
|
|
|
+ if (allErrorOrValidateInfo.isEmpty()) {
|
|
|
+ errorMsg = operationResult.getMessage();
|
|
|
+ } else {
|
|
|
+ errorMsg = operationResult.getAllErrorOrValidateInfo().get(0).getMessage();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (errorMsg != null && !errorMsg.isEmpty() || !needWfAssignPersons) {
|
|
|
+ String exist = "已存在";
|
|
|
+ if (errorMsg != null && !errorMsg.contains(exist)) {
|
|
|
+ getView().showErrorNotification(errorMsg);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void afterSubmit() {
|
|
|
+ LOG.info("afterDoSubmit:" + getModel().getDataEntity().get(PositionBillConstant.BILL_NO_KEY));
|
|
|
+ LOG.info("afterDoSubmit getEntityId refresh:" + getView().getFormShowParameter().getAppId());
|
|
|
+ if (HRStringUtils.equals(getView().getFormShowParameter().getAppId(), PositionBillConstant.WFTASK_APP)) {
|
|
|
+ LOG.info("afterDoSubmit refresh:" + getModel().getDataEntity().get(PositionBillConstant.BILL_NO_KEY));
|
|
|
+ getView().getParentView().invokeOperation(PositionBillConstant.REFRESH_OP);
|
|
|
+ getView().invokeOperation(PositionBillConstant.CLOSE_OP);
|
|
|
+ } else {
|
|
|
+ getView().updateView();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private void deleteRowsConfirm(String callBackId) {
|
|
|
long id = getModel().getDataEntity().getLong(PositionBillConstant.ID_KEY);
|
|
|
- HRBaseServiceHelper helper = new HRBaseServiceHelper(PositionBillConstant.HBPM_POSITIONHR);
|
|
|
+ HRBaseServiceHelper helper = new HRBaseServiceHelper(PositionBillConstant.NCKD_POSITIONBILL_ENTITY);
|
|
|
QFilter idFilter = new QFilter(PositionBillConstant.ID_KEY, QCP.equals, id);
|
|
|
DynamicObject dyn = helper.queryOne(String.join(",", PositionBillConstant.ID_KEY, PositionBillConstant.BILL_STATUS_KEY), new QFilter[]{idFilter});
|
|
|
String billstatus;
|
|
|
if (Objects.isNull(dyn)) {
|
|
|
- billstatus = "A";
|
|
|
+ billstatus = RegBillStatusEnum.TEMPSTORAGE.getCode();
|
|
|
} else {
|
|
|
billstatus = dyn.getString(PositionBillConstant.BILL_STATUS_KEY);
|
|
|
}
|
|
|
@@ -287,7 +483,7 @@ public class PositionBillFormPlugin extends AbstractFormPlugin implements Before
|
|
|
public void registerListener(EventObject e) {
|
|
|
super.registerListener(e);
|
|
|
|
|
|
- EntryGrid entryGrid = getControl(String.join("_", PositionBillConstant.NCKD_ENTRYENTITY, PositionBillConstant.CHANGE_TAG));
|
|
|
+ EntryGrid entryGrid = getControl(PositionBillConstant.NCKD_ENTRYENTITY_CHANGE_KEY);
|
|
|
entryGrid.addDataBindListener(this);
|
|
|
|
|
|
for(String registerBeforeF7Listener : getRegisterBeforeF7ListenerControlList()) {
|
|
|
@@ -301,7 +497,7 @@ public class PositionBillFormPlugin extends AbstractFormPlugin implements Before
|
|
|
}
|
|
|
|
|
|
private List<String> getRegisterBeforeF7ListenerControlList() {
|
|
|
- return Arrays.asList(PositionBillConstant.NCKD_DISORG_KEY, String.join("_", PositionBillConstant.ORG_KEY, PositionBillConstant.CHANGE_TAG), String.join("_", PositionBillConstant.NCKD_POSITION, PositionBillConstant.CHANGE_TAG), String.join("_", PositionBillConstant.NCKD_PARENT, PositionBillConstant.CHANGE_TAG));
|
|
|
+ return Arrays.asList(PositionBillConstant.NCKD_DISORG_KEY, String.join("_", PositionBillConstant.ORG_KEY, PositionBillConstant.CHANGE_TAG), String.join("_", PositionBillConstant.NCKD_POSITION_KEY, PositionBillConstant.CHANGE_TAG), String.join("_", PositionBillConstant.NCKD_PARENT, PositionBillConstant.CHANGE_TAG));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -324,12 +520,12 @@ public class PositionBillFormPlugin extends AbstractFormPlugin implements Before
|
|
|
IDataEntityType parent = property.getParent();
|
|
|
if (!checkOrgValue(beforeF7SelectEvent, property, parent)) {
|
|
|
ListShowParameter showParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
|
|
- if (fieldKey.equals(String.join("_", PositionBillConstant.NCKD_POSITION, PositionBillConstant.CHANGE_TAG))) {
|
|
|
+ if (fieldKey.equals(String.join("_", PositionBillConstant.NCKD_POSITION_KEY, PositionBillConstant.CHANGE_TAG))) {
|
|
|
showParameter.getCustomParams().put(PositionBillConstant.CP_SEARCHDATE, date);
|
|
|
PositionBillServiceHelper.filterF7Org(getView(), beforeF7SelectEvent, null);
|
|
|
setFilterByOrg(beforeF7SelectEvent);
|
|
|
} else if (fieldKey.equals(String.join("_", PositionBillConstant.NCKD_PARENT, PositionBillConstant.CHANGE_TAG))) {
|
|
|
- DynamicObject position = focusEntryDyn.getDynamicObject(String.join("_", PositionBillConstant.NCKD_POSITION, PositionBillConstant.CHANGE_TAG));
|
|
|
+ DynamicObject position = focusEntryDyn.getDynamicObject(String.join("_", PositionBillConstant.NCKD_POSITION_KEY, PositionBillConstant.CHANGE_TAG));
|
|
|
PositionBillServiceHelper.setParentFilter(getView(), position, beforeF7SelectEvent);
|
|
|
beforeF7SelectEvent.getFormShowParameter().setCaption("上级岗位");
|
|
|
if (!HRObjectUtils.isEmpty(position)) {
|
|
|
@@ -399,7 +595,7 @@ public class PositionBillFormPlugin extends AbstractFormPlugin implements Before
|
|
|
}
|
|
|
|
|
|
String fieldName = beforeF7SelectEvent.getProperty().getName();
|
|
|
- if (PositionBillConstant.NCKD_DISORG_KEY.equals(fieldName) || HRStringUtils.equals(String.join("_", PositionBillConstant.NCKD_POSITION, PositionBillConstant.CHANGE_TAG), fieldName)) {
|
|
|
+ if (PositionBillConstant.NCKD_DISORG_KEY.equals(fieldName) || HRStringUtils.equals(String.join("_", PositionBillConstant.NCKD_POSITION_KEY, PositionBillConstant.CHANGE_TAG), fieldName)) {
|
|
|
List<Long> hasPermOrgList = authorizedOrgResult.getHasPermOrgs();
|
|
|
beforeF7SelectEvent.getCustomQFilters().add(new QFilter(String.join(".", PositionBillConstant.ADMINORG, PositionBillConstant.BOID_KEY), QCP.in, hasPermOrgList));
|
|
|
}
|
|
|
@@ -414,7 +610,7 @@ public class PositionBillFormPlugin extends AbstractFormPlugin implements Before
|
|
|
showParameter.setFormId(PositionBillConstant.HAOS_ORGBATCHTREELISTF7_ENTITY);
|
|
|
}
|
|
|
|
|
|
- if (HRStringUtils.equals(fieldKey, String.join("_", PositionBillConstant.NCKD_POSITION, PositionBillConstant.CHANGE_TAG)) || HRStringUtils.equals(fieldKey, String.join("_", PositionBillConstant.NCKD_PARENT, PositionBillConstant.CHANGE_TAG))) {
|
|
|
+ if (HRStringUtils.equalsAny(fieldKey, String.join("_", PositionBillConstant.NCKD_POSITION_KEY, PositionBillConstant.CHANGE_TAG), String.join("_", PositionBillConstant.NCKD_PARENT, PositionBillConstant.CHANGE_TAG))) {
|
|
|
ListShowParameter showParameter = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
|
|
showParameter.setFormId(PositionBillConstant.NCKD_HBPM_POSORGTREELISTF_ENTITY);
|
|
|
}
|
|
|
@@ -424,4 +620,10 @@ public class PositionBillFormPlugin extends AbstractFormPlugin implements Before
|
|
|
private static String getSuffixByFieldKey(String fieldKey) {
|
|
|
return fieldKey.substring(fieldKey.lastIndexOf("_") + 1);
|
|
|
}
|
|
|
+
|
|
|
+ private int getAllEntrySize() {
|
|
|
+ DynamicObjectCollection addDyS = getModel().getEntryEntity(PositionBillConstant.NCKD_ENTRYENTITY_ADD_KEY);
|
|
|
+ DynamicObjectCollection changeDyS = getModel().getEntryEntity(PositionBillConstant.NCKD_ENTRYENTITY_CHANGE_KEY);
|
|
|
+ return addDyS.size() + changeDyS.size();
|
|
|
+ }
|
|
|
}
|