|
|
@@ -0,0 +1,88 @@
|
|
|
+package nckd.jxccl.hr.tsc.plugin.form;
|
|
|
+
|
|
|
+import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.entity.datamodel.IDataModel;
|
|
|
+import kd.bos.entity.datamodel.events.BizDataEventArgs;
|
|
|
+import kd.bos.form.plugin.AbstractFormPlugin;
|
|
|
+import kd.bos.servicehelper.user.UserServiceHelper;
|
|
|
+import kd.sdk.plugin.Plugin;
|
|
|
+import nckd.jxccl.base.common.constant.FormConstant;
|
|
|
+import nckd.jxccl.base.swc.helper.SWCHelper;
|
|
|
+
|
|
|
+import java.util.EventObject;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 应聘申请表单插件 【nckd_applicationbill】
|
|
|
+ * @author Tyx
|
|
|
+ * 时间 2026/1/14 11:18
|
|
|
+ */
|
|
|
+public class ApplicationBillFormPlugin extends AbstractFormPlugin implements Plugin {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void afterBindData(EventObject e) {
|
|
|
+ super.afterBindData(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void afterCreateNewData(EventObject e) {
|
|
|
+ super.afterCreateNewData(e);
|
|
|
+ // 处理员工相关信息
|
|
|
+ getEmployeeInfo();
|
|
|
+ // 携带源页面字段
|
|
|
+ dealAdvertInfo();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取员工相关信息
|
|
|
+ * 1.所在部门/所在单位
|
|
|
+ * 2.政治面貌--废弃 直接查询属性关联出来
|
|
|
+ */
|
|
|
+ public void getEmployeeInfo() {
|
|
|
+ IDataModel model = this.getModel();
|
|
|
+ DynamicObject dyn = model.getDataEntity();
|
|
|
+ // 当前用户ID
|
|
|
+ Long userId = UserServiceHelper.getCurrentUserId();
|
|
|
+ DynamicObject personUserDyn = SWCHelper.queryOne(FormConstant.HRPI_PERSONUSERREL, "employee.id","user",userId);
|
|
|
+ Long employeeId = 0L;
|
|
|
+ if(personUserDyn == null){
|
|
|
+ employeeId = 0L;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ employeeId = personUserDyn.getLong("employee.id");
|
|
|
+ }
|
|
|
+
|
|
|
+ model.setValue("nckd_employee", employeeId);
|
|
|
+ List<Long> employeeIds = new java.util.ArrayList<>();
|
|
|
+ employeeIds.add(employeeId);
|
|
|
+ DynamicObject[] empDyns = SWCHelper.queryEmpPosOrgRelDyns(employeeIds);
|
|
|
+
|
|
|
+ if(empDyns != null && empDyns.length > 0){
|
|
|
+ Long companyId = empDyns[0].getLong("company.id");
|
|
|
+ model.setValue("nckd_company", companyId);
|
|
|
+ Long adminorgId = empDyns[0].getLong("adminorg.id");
|
|
|
+ model.setValue("nckd_adminorg", adminorgId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理从我要应聘-最新职位跳转过来携带的参数
|
|
|
+ */
|
|
|
+ public void dealAdvertInfo() {
|
|
|
+ IDataModel model = this.getModel();
|
|
|
+ Map map = this.getView().getFormShowParameter().getCustomParams();
|
|
|
+ map.keySet().forEach(key -> {
|
|
|
+ if (key.equals("positionId")) {
|
|
|
+ model.setValue("nckd_position", map.get(key));
|
|
|
+ }
|
|
|
+ else if(key.equals("advertId")) {
|
|
|
+ model.setValue("nckd_advert", map.get(key));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|